Michał Karzyński

Using APT from the command line

Debian’s Advanced Packaging Tool (APT) has been ported over to Ubuntu and many other Linux distributions. There are many useful graphical user interfaces to the system such as Synaptic, but sometimes it’s faster or easier to use it from the command line. Here’s how.

Installing

Searching the APT cache to find which package to install. If you want to install APPLICATION_NAME:
apt-cache search APPLICATION_NAME

Installing the appropriate package:
sudo apt-get install PACKAGE

Inspecting

Listing all installed packages:
dpkg -l

Finding which package contains FILE:
dpkg -S FILE

Upgrading

Update the lists of available packages:
sudo apt-get update

Upgrade all installed packages to the latest available versions:
sudo apt-get upgrade

Comments