Installing a new software package via a command line terminal in Ubuntu Karmic Koala (and basically all the other versions preceding it) is deceptively easy thanks to the powerful apt-get command that is used as the interface into Ubuntu’s Advanced Packaging Tool (APT). It can be used to install new software applications, upgrade existing software packages, update the current package list index and even go as far as upgrading the entire Ubuntu system.

The usage of apt-get to install a software package (like the network scanner nmap for example) is as simple as entering:

sudo apt-get install nmap

Similarly, to remove a package you simply change the above command to:

sudo apt-get remove nmap

Note that you can specify multiple packages to be installed or removed, separated by spaces. So for example sudo apt-get nmap gedit would install nmap and gedit respectively. Apt-get is also quite useful for updating the package index, in other words the database that holds all the available packages from the repositories defined in the /etc/apt/sources.list information file. The command to do this is:

sudo apt-get update

Lastly, apt-get is even powerful enough to update your Ubuntu installation itself. First run an update against your package index (as above) and then type:

sudo apt-get upgrade

As for log files of apt-get activity, see /var/log/dpkg.log. For more help on the command, a simple apt-get help will suffice.

There. Now you know! :)

(And for an easter egg while you’re at it, you may as well enter apt-get moo. If you get an answer, well then at least you know that you have Super Cow Powers!)

Related Link: