apthelp: Often used stuff in the apt package management family

Alan Robert Clark

February 8, 2019

Printable pdf versionHEVEA

The apt system sources are configured in /etc/apt/sources.list.

deb http://debian.mirror.ac.za/debian/ stretch main contrib non-free
deb http://debian.mirror.ac.za/debian/ stretch-updates main contrib non-free
deb http://debian.mirror.ac.za/debian/ stretch-backports main contrib non-free

deb http://security.debian.org/debian-security stretch/updates main contrib non-free

Useful package-level commands are apt-get, apt-cache, and the per-package command dpkg.

apt-ssimulate = dry-run
 updateUpdates the database. RUN BEFORE ANY apt command.
 dist-upgradeSame as upgrade, but sorts dependancies.
 install pkg1 pkg2… 
 download pkg1 pkg2…puts .deb in current dir. Proxy!
 remove pkg1 pkg2… 
 purge pkg1 pkg2…removes, including configuration files.
 autoremoveremoves old dependancies. BEWARE! Do not leave too long!
 checkdatabase sanity.
 cleanget rid of .deb files.
apt-cachesearch x yAnything with x y (-d Descrip too)
 show pkginfo
 policy pkginstalled?
 pkgnames pkgUninstalled pkgs available
 showpkg pkgDeps of uninstalled pkg
 depends pkgDeps of installed pkg
 statsDatabase statistics.
dpkg-l pkglists installed pkg. All w/o pkg.
 -L pkglists files installed by pkg
 -S filenamelists pkg to which filename belongs

This document was translated from LATEX by HEVEA.