[GNU/Linux] How to manage deb packages in Ubuntu from the command line using apt-cache

| | 2 min read

In Ubuntu, new applications are usually available as deb packages. Although Ubuntu comes packaged with gui package management tools like synaptic, the command line provides a much faster way. Read on to know how to manage deb packages in Ubuntu from the command line using apt-cache.

'apt-cache search' - Used to search for repositories.

If you want to install a package and if you want to search for it i.e. check whether it is a valid package, you can use apt-cache search. For example

 apt-cache 'package-name'

Suppose you want to search for the package skype

 apt-cache search skype  
pidgin-skype - Skype plugin for libpurple messengers
pidgin-skype-dbg - Skype plugin for libpurple messengers (debug symbols)
earcandy - Sound level manager for PulseAudio
skype - Skype 

'apt-cache search' - Used to search package using package description.

That is, if you want to install phpmyadmin, you can search for it in'apt-cache search php'. This will list all the packages relating to php, including phpmyadmin

'apt-cache show 'package-name' : To display the basic information about a package.'

For example : You can try this by going through the command 'apt-cache show skype'

This will list all the details the package skype

You will get something like this


Package: skype
Status: install ok installed
Priority: extra
Section: non-free/net
Installed-Size: 28722
Maintainer: Skype Technologies 
Architecture: i386
Version: 2.2.0.35-1
Depends: libasound2 (>> 1.0.17), libc6 (>= 2.7-1), libgcc1 (>= 1:4.3), libqt4-dbus (>= 4.4.3), libqt4-network (>= 4.4.3), libqtcore4 (>= 4.4.3), libqtgui4 (>= 4.4.3), libstdc++6 (>= 4.3), libx11-6, libxext6, libxss1, libxv1
Conffiles:
 /etc/dbus-1/system.d/skype.conf d09fd2adb2487dbaaeb97c43f6cdc08d
Description: Skype
 .
 Skype is software that enables people around the world to connect via instant message, audio conferencing, and video phone.
 Millions of individuals and businesses use Skype to make free video and voice calls,
 send instant messages and share files with other Skype users.
 Everyday, people also use Skype to make low-cost calls to landlines and mobiles.
 .
 * Make free Skype-to-Skype calls to anyone else, anywhere in the world.
 * Call to landlines and mobiles at great rates.
 * Group chat with up to 200 people or conference call with up to 25 others.
 * Free to download.