apt

package management system

Interactive tool for apt-get and apt-cache

apt [-h] [-o=config_string] [-c=config_file] [-t=target_release] [-a=architecture]
{update| list patt | search patt | show patt | edit-sources patt |
| install pkg [{=pkg_version_number | /target_release}]| upgrade | full-upgrade {-v | --version}
| remove pkg| {-h | --help}}

Provides a high-level commandline interface for the package management system. Options are better for interactive usage compared to other APT tools.

update
apt-get
Download current repository information.

First thing to do before other commands to get most recent status.

upgrade
apt-get
Install upgrades of all packages.
New packages will be installed if required to satisfy dependencies.
Existing packages are not removed.
An upgrade requiring removal of an installed package isn't performed.
full-upgrade
apt-get
Removes packages if needed.
install
reinstall AmbiguousPkg
remove
purge


apt-get

Actions can be overridden for specific packages by appending a plus(+) to the name to install or \ a minus(-) to remove.

AmbiguousPkg is resolved using regex, glob or exact match.

A specific version can be selected for installation by following the name with an equals(=) and the version or
append the name with a slash(/) and codename (buster, bullseye, sid … ) or
suite name (stable, testing, unstable).
This will select versions from that release for dependencies.

Remove includes all package data, leaving modified configuration files.
If the remove was an error, installl will restore it.

Purge remove configuration files as well.

Does not affect data or configuration in your home directory.

autoremove
apt-get
Remove packages automatically installed to satisfy dependencies no longer needed.

Check that the list does not include applications needed which were installed as a dependency package.
To mark a package as manually(i.e. not automatically) installed use apt-mark.

search regx
apt-cache
Search for the given regex term in the list.
Useful for finding packages having a specific feature.
For a package including a specific file use apt-file.
show regexPkg
apt-cache
Including dependencies, installation and download size, sources the package is available from, description and more.
Review this before allowing apt to remove a package or while searching for new packages to install.
list globPattern
work-in-progress
Display a list of packages.
Supports glob patterns for matching names and listing installed (--installed), upgradeable (--upgradeable) or all available (--all-versions) versions.
edit-sources
work-in-progress
Permits editing sources.list providing basic sanity checks.

Features are available in dedicated tools like apt-get and apt-cache.

Default value (see apt.conf are different in some cases

apt should be avoided in scripts.

See

apt-get, apt-cache, sources.list, apt.conf, apt-config, The /usr/share/doc/apt-doc APT User's guide in apt_preferences, the APT Howto.

/etc/apt:
apt.conf.d/
  reformatted

01autoremove APT { NeverAutoRemove { "^firmware-linux.*"; "^linux-firmware$"; }; VersionedKernelPackages { # linux kernels "linux-image"; "linux-headers"; "linux-image-extra"; "linux-signed-image"; # kfreebsd kernels "kfreebsd-image"; "kfreebsd-headers"; # hurd kernels "gnumach-image"; # (out-of-tree) modules ".*-modules"; ".*-kernel"; "linux-backports-modules-.*"; # tools "linux-tools"; }; Never-MarkAuto-Sections { "metapackages"; "contrib/metapackages"; "non-free/metapackages"; "restricted/metapackages"; "universe/metapackages"; "multiverse/metapackages"; }; Move-Autobit-Sections { "oldlibs"; "contrib/oldlibs"; "non-free/oldlibs"; "restricted/oldlibs"; "universe/oldlibs"; "multiverse/oldlibs"; }; };
01autoremove-kernels // DO NOT EDIT! File autogenerated by /etc/kernel/postinst.d/apt-auto-removal APT::NeverAutoRemove { "^linux-image-4\.19\.42-v7\+$"; … "^linux-tools-4\.19\.66-v7l\+$"; };
20listchanges DPkg::Pre-Install-Pkgs { "/usr/bin/apt-listchanges --apt || test $? -lt 10"; }; DPkg::Tools::Options::/usr/bin/apt-listchanges::Version "2"; DPkg::Tools::Options::/usr/bin/apt-listchanges::InfoFD "20";
20packagekit DPkg::Post-Invoke { "/usr/bin/test -e /usr/share/dbus-1/system-services/org.freedesktop.PackageKit.service && /usr/bin/test -S /var/run/dbus/system_bus_socket $ }; APT::Update::Post-Invoke-Success { "/usr/bin/test -e /usr/share/dbus-1/system-services/org.freedesktop.PackageKit.service && /usr/bin/test -S /var/run/dbus/system_bus_socket $ }; 50apt-file.conf 50raspi 70debconf listchanges.conf preferences.d/ sources.list sources.list.d/ trusted.gpg trusted.gpg.d/