apt-get reference

One of Debian‘s greatest features is the apt package manager, and therefore the apt-get program for getting, managing and installing packages.  Here I have compiled a quick reference of some of the more commonly used commands.

apt-get install
This will install a package.

apt-get -f install
This will force the install of a package.

apt-get install –reinstall
This will reinstall an already installed package.

apt-get upgrade
This will upgrade packages to the most recent versions. Packages will not be updated if it would require other packages to be either removed or installed.

apt-get dist-upgrade
This is a lot like apt-get upgrade, except that it will remove or install any programs needed to ensure that all packages are at the most recent version.

apt-get remove
This will remove a package and leave any configuration files.

apt-get remove –purge
This will remove a package and also remove all configuration files.

apt-get clean
This clears out the local repository of retrieved package files.

apt-get autoclean
Like clean, autoclean clears out the local repository of retrieved package files. The difference is that it only removes package files that can no longer be downloaded, and are largely useless.

apt-get autoremove
This will remove packages that were automatically installed to satisfy dependencies for some package and that are no more needed.

apt-cache search
This will search the descriptions of packages for the requested pattern.

apt-cache show
This will show the description of the supplied package.

dpkg -s
This will give information about a package, including configuration files, a description, dependencies, and other facts.

dpkg -S
apt-file search
Will attempt to find out which package contains this file.

apt-file list
dpkg -c

This will return a list of all files in this package.

auto-apt run
This will attempt to run a command, most often “./configure”, and attempt to download any packages that are needed to fill it’s dependencies. It takes the dependency hunting out of building from source.

apt-get update
apt-file update
auto-apt update

This will update the package lists to the most recently available versions (within the selected repositories as seen in /etc/apt/sources.list).

One thought on “apt-get reference

  1. Pingback: apt-get quick reference | Solarum - Information For Everyone

Leave a Reply

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