Docu review done: Tue 17 Oct 2023 10:53:15 AM CEST

apt

Table of Content

Commands for

apt

CommandsDescriptions
apt install [packagename]=[versoin]installs package in given version
apt download [packagename]downloads only the deb file
apt changelog [packagename]shows changelog for package
apt --with-new-pkgs upgrade [packagenames]upgrade held back packages by installing new dependencies

apt-cache

CommandsDescriptions
apt-cache showpkg [packagename]shows dependencies in details
apt-cache statsshows local cache information
apt-cache policylists repositories and there priorities as well as pined packages
apt-cache policy [packagename]shows priorities for given package only (for all package versions)
apt-cache rdepends [packagename]lists reverse dependencies for package
apt-cache rdepends [packagename] --installedsame as above + only installed packages
apt-cache rdepends [packagename] --installed --no-recommends --no-suggestssame as above + no recommends and no suggests

apt-get

CommandsDescriptions
apt-get check [packagename]generates dependency tree, shows broken dependencies
apt-get --no-install-recommends [packagename]Does not treat recommended packages for installation
apt-get --install-suggests [packagename]Treats suggested packages as dependencies

apt-mark

CommandsDescriptions
hold [packagename]holds package to current installed version
unhold [packagename]removes hold on package
showholdlists all packages with have the hold mark set

apt-key

CommandsDescriptions
apt-keyinteract with gpg keys
apt-key export <keyid> | gpg --dearmour -o /etc/apt/trusted.gpg.d/<name of project/tyeam/...>.gpgExports and creates .gpg file for keys stored in trusted.db

apt-show-versions

CommandsDescriptions
apt-show-versionsparses the dpkg status file and the APT lists for the installed and available package versions and distribution and shows upgrade options within the specific distribution of the selected package
`apt-show-versions [-i–initialize]`
`apt-show-versions [-u–upgradable]`
`apt-show-versions [-p–package] [package-name] [-a
`apt-show-versions [-r–regex] [regex]`
`apt-show-versions [-R–regex-all] [regex]`

Configuration

No Recommends

To disable recommendations (not recommended) you can add the following line to your apt config:

APT::Install-Recommends "false";

No Suggestions

To disable suggestions (might consider it, but think about it first) you can add the following line to your apt config:

APT::Install-Suggests "false";

Autoremove

If you do not want to get packages all the time autoremoved (without your interaction) you can use this config lines inside your apt.conf:

APT::Get::AutomaticRemove "0";
APT::Get::HideAutoRemove "1";

This will disable the autoremove and hides it also from your apt execution.

Keep in mind, that you have to take care of that then on your own! To keep your system clean and small

Files

DirectoryDescription
/var/cache/aptpackage cache
/var/lib/apt/listscontains (In)Release/Package from all apt sources
CommandsDescriptions
ar vr [file.deb]Extracts content of Debian package