Chances are good that you’re already familiar with apt-get, a command which uses the “advanced package tool” to interact with the operating system’s underlying package system. The most relevant and useful commands are, (to be run as root):

This command installs the package(s) specified, along with any dependencies.

This command removes the package(s) specified, but does not remove dependencies.

This command removes any “orphaned” dependencies which remain installed but are not used by any applications.

Removes downloaded package files (.deb) for software that are already installed.

Combines the functions of remove and clean for a specific package. Also removes configuration files for the given package.

Reads the /etc/apt/sources.list file and updates the system’s database of packages available for installation. Run this after changing sources.list.

Upgrades all packages if there are updates available. Run this after running apt-get update.
While apt-get likely provides the most often used functionality of the package management, apt provides additional information that you may find useful in the apt-cache command.

If you know the name of a piece of software but apt-get install fails or points to the wrong software, use search to look for other possible names, if you need to find out the name of a package that you know is in the system.

The search interface only provides package names. If you need to learn more about a package, including dependency information, version numbers and a basic description, run this.

Lists the packages that the specified packages depends upon in a tree. These are the packages that will be installed with the apt-get install command.

Generates and outputs a list of packages that that depend upon the specified package. This list can often be rather long.

Generates a list of the currently installed packages on your system. This list is often rather long, so it is best to pipe its output through a command like less.

Share: