How to know if a package is installed

We can use the aptitude command to know if a package has been installed on Debian GNU/Linux or derivative

$ sudo aptitude show cmus
Package: cmus                            
New: yes
State: installed
Automatically installed: no
Version: 2.3.3-2
Priority: optional
Section: sound
...

If we don't know the exact name of the package we can search it using apt-cache

$ sudo apt-cache -n keyword

Example

$ sudo apt-cache -n cmus
cmus-plugin-ffmpeg - lightweight ncurses audio player (FFmpeg plugin)
cmus - lightweight ncurses audio player
cmuscheme48-el - Emacs mode specialized for Scheme48

In CentOS/RHEL/Fedora you can use yum

# yum info httpd
Reading repository metadata in from local files
Installed Packages
Name   : httpd
Arch   : i386
Version: 2.2.6
Release: 1.fc6
Size   : 2.6 M
Repo   : installed
Summary: Apache HTTP Server
...

Furgher reading

– man apt-cache
– man aptitude
– man yum

Leave a Comment

Your email address will not be published. Required fields are marked *

This site uses Akismet to reduce spam. Learn how your comment data is processed.