Cheat sheet for apt; “xyz” is just a place holder.
System updating.
apt-get update Downloads new package lists.
apt-get upgrade Installs newer versions of the packages you have.
apt-get dist-upgrade Performs the upgrade in prior command, and intelligently handles changing dependencies with new versions of packages, and will attempt to upgrade the most important packages at the expense of less important ones if necessary; sometimes removes packages in rare necessary instances.
Package searching and package information.
apt-cache pkgnames List all available packages.
apt-cache xyz Search for a package.
apt-cache search xyz Search for a package with results providing a description.
apt-cache pkgnames xyz List down all the packages starting with “xyz”.
apt-cache show xyz Check package information.
apt-cache showpkg xyz Check dependencies for a package.
apt-cache stats Display overall statistics about the cache.
Package installation and removal.
apt-get download xyz Only download package to current working directory.
apt-get install xyz Downloads and installs packages. Install more than one package by having as many packages you want after the first.
apt-get install xyz --no-upgrade Marks a package to never be upgraded.
apt-get install xyz --only-upgrade Upgrades only specified packages, and disables new installation of packages.
apt-get install '*name*' Use of * wildcard will install several packages that contains the ‘*name*‘ string, as in package name.
apt-get changelog xyz Downloads a package change-log and shows the package version installed.
apt-get check Checks for broken dependencies.
apt-get remove xyz Uninstalls package.
apt-get purge xyz Deletes out configuration files left over from package.
apt-get autoremove Deletes orphaned packages.
apt-get clean Deletes downloaded deb files.
apt-get autoclean Deletes downloaded deb files that can’t be downloaded anymore.
Source code packages.
apt-get source xyz Download and unpack source code of a package to a directory.
apt-get build-dep xyz Download and install build dependencies for a package.
apt-get --compile source xyz Download, unpack, and compile source code.
More brush up.
apt-cache manual.
apt-get manual.