APT-GET(8)

๐Ÿ’… APT-GET(8) โ€” the manual page, but make it group chat

okay so you opened apt-get(8), the APT manual, and bestieโ€ฆ it's a lot. don't panic. i got you. we're gonna go through this together, top to bottom, and by the end you're gonna be the main character of package management. periodt. ๐Ÿซถ


โœจ NAME โœจ

apt-get โ€” the APT package handling utility, and it's the command-line interface, no cap.


๐ŸŒธ SYNOPSIS ๐ŸŒธ

here's the whole shape of it, exactly as written, don't let it intimidate you:

apt-get [-sqdyfmubV] [-o=config_string] [-c=config_file]
        [-t=target_release] [-a=architecture] {update | upgrade |
        dselect-upgrade | dist-upgrade |
        install pkg [{=pkg_version_number | /target_release}]...  |
        remove pkg...  | purge pkg...  |
        source pkg [{=pkg_version_number | /target_release}]...  |
        build-dep pkg [{=pkg_version_number | /target_release}]...  |
        download pkg [{=pkg_version_number | /target_release}]...  |
        check | clean | autoclean | autoremove | {-v | --version} |
        {-h | --help}}

like yes there are a Lot of bracketed things. we'll get to all of them. breathe. ๐Ÿ’–


๐Ÿฆ‹ DESCRIPTION ๐Ÿฆ‹

so apt-get is the command-line tool for handling packages, and honestly it's lowkey the user's "back-end" to all the other tools that use the APT library. there are several "front-end" interfaces hanging around too, like aptitude(8), synaptic(8) and wajig(1) โ€” those are the pretty faces, apt-get is the one doing the actual work. ๐Ÿ’…

here's the rule: unless you pass the -h or --help option, one of the commands below must be present. no vibes-only invocations. one of these, or nothing.


๐ŸŒˆ update

update resynchronizes the package index files from their sources. the indexes of available packages get fetched from the location(s) specified in /etc/apt/sources.list. for example, when you're using a Debian archive, this command retrieves and scans the Packages.gz files, so that info about new and updated packages is available.

an update should always be performed before an upgrade or dist-upgrade. always always always. ๐Ÿ™ˆ

heads up bestie: the overall progress meter will be incorrect, because the size of the package files literally cannot be known in advance. it's not broken, it's just doing its best. ๐Ÿ˜ญ

๐Ÿ”ฅ upgrade

upgrade installs the newest versions of all packages currently installed on the system, from the sources enumerated in /etc/apt/sources.list. packages currently installed with new versions available are retrieved and upgraded โ€” but under no circumstances are currently installed packages removed, or packages not already installed retrieved and installed. nope. not happening. that's not this command's job.

new versions of currently installed packages that can't be upgraded without changing the install status of another package will be left at their current version. they're just gonna sit there. it's giving "not my problem".

an update must be performed first so that apt-get knows that new versions of packages are available.

when a package is supplied as an argument, the package will be installed prior to the upgrade action.

๐Ÿ‘‘ dist-upgrade

dist-upgrade does everything upgrade does, but in addition it also intelligently handles changing dependencies with new versions of packages. apt-get has a "smart" conflict resolution system, and it will attempt to upgrade the most important packages at the expense of less important ones if necessary.

so likeโ€ฆ the dist-upgrade command may therefore remove some packages. yes, that's the trade-off. iconic but a little scary. ๐Ÿ’€

the /etc/apt/sources.list file contains a list of locations from which to retrieve desired package files. also see apt_preferences(5) for a mechanism for overriding the general settings for individual packages.

when a package is supplied as an argument, the package will be installed prior to the upgrade action.

๐Ÿงš dselect-upgrade

dselect-upgrade is used in conjunction with the traditional Debian packaging front-end, dselect(1). it follows the changes made by dselect(1) to the Status field of available packages, and performs the actions necessary to realize that state (for instance, the removal of old and the installation of new packages). nostalgic vibes fr fr.

๐Ÿ“ install

install is followed by one or more packages desired for installation or upgrading. each package is a package name, not a fully qualified filename โ€” for instance, in a Debian system, apt-utils would be the argument provided, not apt-utils_3.3.5_amd64.deb. put the filename away bestie, that's not what we're doing here.

all packages required by the package(s) specified for installation will also be retrieved and installed. the /etc/apt/sources.list file is used to locate the desired packages.

okay, cute little tricks:

  • if a hyphen is appended to the package name (with no intervening space), the identified package will be removed if it's installed.
  • similarly a plus sign can be used to designate a package to install.

these latter features may be used to override decisions made by apt-get's conflict resolution system. you're the boss. ๐Ÿ’…

picking a version: a specific version of a package can be selected for installation by following the package name with an equals and the version of the package to select. this causes that version to be located and selected for install. alternatively a specific distribution can be selected by following the package name with a slash and the version of the distribution or the Archive name (stable, testing, unstable).

โš ๏ธ both of the version selection mechanisms can downgrade packages and must be used with care. like, actually care. please.

the sneaky good use case: this is also the target to use if you want to upgrade one or more already-installed packages without upgrading every package you have on your system. unlike the "upgrade" target, which installs the newest version of all currently installed packages, "install" will install the newest version of only the package(s) specified. simply provide the name of the package(s) you wish to upgrade, and if a newer version is available, it (and its dependencies, as described above) will be downloaded and installed. targeted. precise. slay. โœจ

finally, the apt_preferences(5) mechanism allows you to create an alternative installation policy for individual packages.

regex time (read the warning tho): if no package matches the given expression and the expression contains one of ., ? or *, then it is assumed to be a POSIX regular expression, and it is applied to all package names in the database. any matches are then installed (or removed). note that matching is done by substring, so lo.* matches how-lo and lowest. if this is undesired, anchor the regular expression with a ^ or $ character, or create a more specific regular expression.

๐Ÿ’€ ngl this part is deprecated: fallback to regular expressions is deprecated in APT 2.0, has been removed in apt(8), except for anchored expressions, and will be removed from apt-get(8) in a future version. use apt-patterns(7) instead. i'm just the messenger.

๐ŸŽ€ reinstall

reinstall is an alias for install --reinstall. that's it. that's the whole thing. love a short one.

๐ŸŒธ remove

remove is identical to install except that packages are removed instead of installed.

note that removing a package leaves its configuration files on the system. it's not a full goodbye, it's a "we'll always have /etc".

if a plus sign is appended to the package name (with no intervening space), the identified package will be installed instead of removed. chaos move, but valid.

๐Ÿฆ‹ purge

purge is identical to remove except that packages are removed and purged โ€” any configuration files are deleted too. this is the actual goodbye. no leftovers, no memories, nothing. ๐Ÿซถ

โญ source

source causes apt-get to fetch source packages. APT will examine the available packages to decide which source package to fetch. it will then find and download into the current directory the newest available version of that source package, while respecting the default release โ€” set with the option APT::Default-Release, the -t option, or per package with the pkg/release syntax, if possible.

the arguments are interpreted as binary and source package names. see the --only-source option if you want to change that.

big important thing: source packages are tracked separately from binary packages, via deb-src lines in the sources.list(5) file. this means you'll need to add such a line for each repository you want to get sources from โ€” otherwise you will probably get either the wrong (too old/too new) source versions or none at all. ๐Ÿ˜ญ

  • if the --compile option is specified, then the package will be compiled to a binary .deb using dpkg-buildpackage for the architecture as defined by the --host-architecture option.
  • if --download-only is specified, then the source package will not be unpacked.

a specific source version can be retrieved by postfixing the source name with an equals and then the version to fetch, similar to the mechanism used for the package files. this enables exact matching of the source package name and version, implicitly enabling the APT::Get::Only-Source option.

note that source packages are not installed and tracked in the dpkg database like binary packages โ€” they're simply downloaded to the current directory, like source tarballs. just vibes in a folder.

๐Ÿ’œ build-dep

build-dep causes apt-get to install/remove packages in an attempt to satisfy the build dependencies for a source package. by default the dependencies are satisfied to build the package natively. if desired, a host-architecture can be specified with the --host-architecture option instead.

the arguments are interpreted as binary or source package names. see the --only-source option if you want to change that.

๐ŸŒˆ satisfy

satisfy causes apt-get to satisfy the given dependency strings. the dependency strings may have build profiles and architecture restriction list as in build dependencies. they may optionally be prefixed with "Conflicts: " to unsatisfy the dependency string. multiple strings of the same type can be specified.

example, straight up:

apt-get satisfy "foo" "Conflicts: bar" "baz (>> 1.0) | bar (= 2.0), moo"
the legacy operator </> is not supported, use <=/> instead. don't try it. it will not work. i'm warning you with love.

๐Ÿงš check

check is a diagnostic tool; it updates the package cache and checks for broken dependencies. a little health checkup for your system. ๐Ÿฉบ

๐Ÿ“ download

download will download the given binary package into the current directory. the authenticity of the package data is ensured as usual. safe, verified, cute.

๐Ÿ’… clean

clean clears out the local repository of retrieved package files. it removes everything but the lock file from /var/cache/apt/archives/ and /var/cache/apt/archives/partial/. deep clean. no survivors (except the lock file, the lock file stays).

๐Ÿ‘‘ autoclean (and the auto-clean alias since 1.1)

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. this allows a cache to be maintained over a long period without it growing out of control.

the configuration option APT::Clean-Installed will prevent installed packages from being erased if it is set to off.

๐ŸŒŸ distclean (and the dist-clean alias)

distclean removes all files under /var/lib/apt/lists except Release, Release.gpg, and InRelease. it can be used for example, when finalizing images distributed to users. the release files are kept for security reasons, to prevent various types of attacks. genuinely important, don't go deleting those manually thinking you're being tidy. ๐Ÿซถ


okay that's the commands section done and honestly? you ate. ๐Ÿฝ๏ธ the options list is next and it'sโ€ฆ long. but we're gonna get through it together, obviously. ๐Ÿ’–

  • autoremove (plus the auto-remove alias, which has existed since 1.1) โ€” bestie this one is the cleanup queen ๐Ÿ‘‘ she goes and yeets the packages that got installed automatically just to satisfy other packages' dependencies, and which nobody needs anymore. Pure "thank u, next" energy ๐Ÿ’…
  • autopurge โ€” same vibe as autoremove but she goes further: she also deletes the config files. Literally just a shortcut for autoremove --purge, no cap. ๐Ÿงน
  • changelog โ€” downloads a package's changelog and shows it to you through sensible-pager. By default you get the changelog for the version that's currently installed, but plot twist โ€” you can pass the same options you'd pass to the install command. ๐Ÿ“œ
  • indextargets โ€” by default this shows a deb822-formatted listing of info about all the data files (a.k.a. index targets) that apt-get update would download. It supports a --format option to change the output format, and it also accepts lines of the default output to filter the records by. The main character purpose here is being an interface for external tools that work with APT โ€” they get info and filenames of downloaded files so they can reuse them instead of re-downloading everything themselves. The detailed docs are deliberately not here, they're chilling in /usr/share/doc/apt/acquire-additional-files.md.gz, shipped by the apt-doc package. ๐Ÿฆ‹

โœจ OPTIONS โœจ

okay so every single command line option here can also be set in the configuration file โ€” the descriptions will tell you which config option to set. And for boolean options you can override the config file with stuff like -f-, --no-f, -f=no, or several other variations. slay ๐Ÿ’…

  • --no-install-recommends โ€” do not treat recommended packages as a dependency for installing. Config item: APT::Install-Recommends.
  • --install-suggests โ€” okay so the opposite vibe: treat suggested packages as a dependency for installing. Config item: APT::Install-Suggests.
  • -d, --download-only โ€” download only, bestie. Package files get retrieved and that's it โ€” no unpacking, no installing. Config item: APT::Get::Download-Only.
  • -f, --fix-broken โ€” the fixer upper ๐Ÿ”ง she attempts to correct a system with broken dependencies in place. When used with install/remove, this option can omit any packages, which lets APT deduce a likely solution. If you do specify packages, they have to completely correct the problem. Sometimes this option is literally necessary when you're running APT for the first time โ€” APT itself does not allow broken package dependencies to exist on a system. And ngl, a system's dependency structure can get so corrupt that it needs manual intervention (which usually means using dpkg --remove to eliminate some of the offending packages). Heads up: using this option together with -m may produce an error in some situations. Config item: APT::Get::Fix-Broken.
  • -m, --ignore-missing, --fix-missing โ€” ignore missing packages. If packages can't be retrieved, or they fail the integrity check after retrieval (corrupted package files), hold those packages back and handle the result. Using this together with -f may produce an error in some situations. And if a package is selected for installation (especially if it's named on the command line) and it couldn't be downloaded, then it will be silently held back โ€” so pay attention ๐Ÿ‘€ Config item: APT::Get::Fix-Missing.
  • --no-download โ€” disables downloading of packages entirely. Best used with --ignore-missing to force APT to use only the .debs it has already downloaded. Config item: APT::Get::Download.
  • -q, --quiet โ€” quiet mode, produces output suitable for logging, omitting progress indicators. More q's = more quiet, up to a maximum of 2. You can also use -q=# to set the quiet level and override the configuration file. > โš ๏ธ Note that quiet level 2 implies -y; you should never use -qq without a no-action modifier such as -d, --print-uris or -s, because APT may decide to do something you did not expect. ๐Ÿ˜ญ Config item: quiet.
  • -s, --simulate, --just-print, --dry-run, --recon, --no-act โ€” no action; she performs a simulation of the events that would occur based on the current system state, but doesn't actually change the system. Locking will be disabled (Debug::NoLocking), so the system state could change while apt-get is running. Simulations can also be run by non-root users โ€” but those users might not have read access to all apt config, which distorts the simulation. A notice expressing this warning is also shown by default for non-root users (APT::Get::Show-User-Simulation-Note). Config item: APT::Get::Simulate.

Simulated runs print out a series of lines, each one representing a dpkg operation: configure (Conf), remove (Remv) or unpack (Inst). Square brackets indicate broken packages, and empty square brackets indicate breaks that are of no consequence (rare).

  • -y, --yes, --assume-yes โ€” automatic yes to prompts ๐Ÿ’– assume "yes" as the answer to all prompts and run non-interactively. But if an undesirable situation occurs โ€” like changing a held package, trying to install an unauthenticated package, or removing an essential package โ€” then apt-get will abort. Config item: APT::Get::Assume-Yes.
  • --assume-no โ€” automatic "no" to all prompts, no questions asked. Config item: APT::Get::Assume-No.
  • --no-show-upgraded โ€” don't show the list of all packages that are to be upgraded. Config item: APT::Get::Show-Upgraded.
  • -V, --verbose-versions โ€” show full versions for upgraded and installed packages. Config item: APT::Get::Show-Versions.
  • --no-list-columns โ€” display package lists without arranging them in columns. By default, package lists are printed in the style of the ls command. Config item: APT::Get::List-Columns.
  • --comment โ€” adds the given value to the Comment: field in history.log. ๐Ÿ“ Config item: APT::History::Comment.
  • -a, --host-architecture โ€” controls which architecture packages are built for by apt-get source --compile, and how cross-build-dependencies are satisfied. By default it is not set, which means the host architecture is the same as the build architecture (which is defined by APT::Architecture). Config item: APT::Get::Host-Architecture.
  • -P, --build-profiles โ€” controls the activated build profiles that a source package is built with by apt-get source --compile, and how build dependencies are satisfied. By default no build profile is active. You can activate more than one at a time by concatenating them with a comma. Config item: APT::Build-Profiles.
  • -b, --compile, --build โ€” compile source packages after downloading them. Config item: APT::Get::Compile.
  • --ignore-hold โ€” ignore package holds; this makes apt-get ignore a hold placed on a package. Highkey useful in conjunction with dist-upgrade to override a large number of undesired holds. Config item: APT::Ignore-Hold.
  • --with-new-pkgs โ€” allow installing new packages when used in conjunction with upgrade. Useful when the update of an installed package requires new dependencies to be installed โ€” instead of holding the package back, upgrade will upgrade the package and install the new dependencies. Note that upgrade with this option will never remove packages, it only allows adding new ones. Config item: APT::Get::Upgrade-Allow-New.
  • --no-upgrade โ€” do not upgrade packages. When used in conjunction with install, no-upgrade will prevent packages on the command line from being upgraded if they're already installed. Config item: APT::Get::Upgrade.
  • --only-upgrade โ€” do not install new packages. When used in conjunction with install, only-upgrade will install upgrades for already-installed packages only and ignore requests to install new packages. Config item: APT::Get::Only-Upgrade.
  • --allow-downgrades โ€” > ๐Ÿ’€ this is a dangerous option that will cause apt to continue without prompting if it's doing downgrades. It should not be used except in very special situations. Using it can potentially destroy your system! ๐Ÿ˜ญ Config item: APT::Get::allow-downgrades. Introduced in APT 1.1.
  • --allow-remove-essential โ€” force yes. > ๐Ÿ’€ Dangerous option that will cause apt to continue without prompting if it's removing essentials. It should not be used except in very special situations. Using it can potentially destroy your system! Config item: APT::Get::allow-remove-essential. Introduced in APT 1.1.
  • --allow-change-held-packages โ€” force yes. > ๐Ÿ’€ Dangerous option that will cause apt to continue without prompting if it's changing held packages. It should not be used except in very special situations. Using it can potentially destroy your system! Config item: APT::Get::allow-change-held-packages. Introduced in APT 1.1.
  • --force-yes โ€” force yes. > ๐Ÿ’€ Dangerous option that will cause apt to continue without prompting if it's doing something potentially harmful. It should not be used except in very special situations. Using force-yes can potentially destroy your system! Config item: APT::Get::force-yes. This one is deprecated and was replaced by --allow-unauthenticated, --allow-downgrades, --allow-remove-essential, --allow-change-held-packages in 1.1.
  • --print-uris โ€” instead of fetching the files to install, their URIs are printed. Each URI will have the path, the destination file name, the size and the expected MD5 hash. ๐Ÿ‘€ Note that the file name to write to will not always match the file name on the remote site! This also works with the source and update commands. When used with the update command, the MD5 and size are not included, and it's up to you to decompress any compressed files. Config item: APT::Get::Print-URIs.
  • --purge โ€” use purge instead of remove for anything that would be removed. An asterisk (*) will be displayed next to packages that are scheduled to be purged. Note: remove --purge is equivalent to the purge command. Config item: APT::Get::Purge.
  • --reinstall โ€” re-install packages that are already installed and at the newest version. Config item: APT::Get::ReInstall.
  • --list-cleanup โ€” bestie this one is ON by default, so you don't even gotta do anything ๐Ÿ’… it makes apt-get babysit /var/lib/apt/lists and yeet the obsolete files so nothing stale is lurking. Want it off? Use --no-list-cleanup. The only reason to turn it off is if you change your sources list, like, constantly. Configuration Item: APT::Get::List-Cleanup.
  • -S, --snapshot โ€” controls which snapshot gets picked for archives that have Snapshot: enabled in the source entry ๐Ÿ‘‘ for example, -S 20220102T030405Z selects a snapshot from January 2nd, 2022 at 03:04:05 UTC. Very specific, very demure. Configuration Item: APT::Snapshot; see also the sources.list(5) manual page.
  • -t, --target-release, --default-release โ€” this one controls the default input to the policy engine โœจ it creates a default pin at priority 990 using the release string you give it, and it overrides the general settings in /etc/apt/preferences. Important though: specifically pinned packages are NOT affected by this option's value. In short? It's your simple little knob for controlling which distribution packages get retrieved from. Some common examples might be -t '2.1*', -t unstable or -t sid. Configuration Item: APT::Default-Release; see also the apt_preferences(5) manual page.
  • --trivial-only โ€” only performs operations that are 'trivial'. Logically you can think of this as related to --assume-yes: where --assume-yes answers yes to any prompt, --trivial-only answers no. ๐Ÿ˜ญ Configuration Item: APT::Get::Trivial-Only.
  • --mark-auto โ€” after a successful install, it marks all the freshly installed packages as automatically installed ๐Ÿซถ which means each of those packages gets removed once no more manually installed packages depend on it. It's literally the same as running apt-mark auto for all installed packages. Configuration Item: APT::Get::Mark-Auto.
  • --no-remove โ€” if any packages are gonna be removed, apt-get immediately aborts without even prompting you ๐Ÿ’€ Configuration Item: APT::Get::Remove.
  • --auto-remove, --autoremove โ€” if the command is either install or remove, then this option acts like running the autoremove command, removing those unused dependency packages ๐ŸŽ€ Configuration Item: APT::Get::AutomaticRemove.
  • --only-source โ€” only has meaning for the source and build-dep commands โœจ it indicates that the given source names are not to be mapped through the binary table. Which means: if you specify this option, those commands will only accept source package names as arguments, rather than accepting binary package names and looking up the corresponding source package. Configuration Item: APT::Get::Only-Source.
  • --diff-only, --dsc-only, --tar-only โ€” download only the diff, dsc, or tar file of a source archive ๐Ÿ‘‘ Configuration Item: APT::Get::Diff-Only, APT::Get::Dsc-Only, and APT::Get::Tar-Only.
  • --arch-only โ€” only process architecture-dependent build-dependencies. Configuration Item: APT::Get::Arch-Only.
  • --indep-only โ€” only process architecture-independent build-dependencies. Configuration Item: APT::Get::Indep-Only.
  • --arch-only --indep-only โ€” okay so when you combine them, you only process build-dependencies that are neither architecture-dependent nor architecture-independent โ€” it's the intersection of the previous two options ๐Ÿฆ‹
  • --allow-unauthenticated โ€” ignores whether packages can be authenticated and doesn't prompt about it. This can be useful while working with local repositories, but it's a huge security risk if data authenticity isn't ensured in another way by the user themselves ๐Ÿšจ The usage of the Trusted option for sources.list(5) entries should usually be preferred over this global override. Configuration Item: APT::Get::AllowUnauthenticated.
  • --allow-insecure-repositories โ€” allows the update command to acquire unverifiable data from configured sources. Otherwise APT fails at the update command for repositories without valid cryptographically signatures ๐Ÿ”ฅ See also apt-secure(8) for details on the concept and the implications. Configuration Item: Acquire::AllowInsecureRepositories.
  • --allow-releaseinfo-change โ€” lets the update command continue downloading data from a repository that changed its information of the release contained in the repository, indicating e.g a new major release. APT will fail at the update command for such repositories until the change is confirmed, so the user is prepared for the change ๐Ÿ’… See also apt-secure(8) for details on the concept and configuration.

Specialist options (--allow-releaseinfo-change-field) exist to allow changes only for certain fields like origin, label, codename, suite, version and defaultpin. See also apt_preferences(5). Configuration Item: Acquire::AllowReleaseInfoChange.

  • --show-progress โ€” shows user friendly progress information in the terminal window when packages are installed, upgraded or removed ๐ŸŒˆ For a machine parsable version of this data see README.progress-reporting in the apt doc directory. Configuration Items: Dpkg::Progress and Dpkg::Progress-Fancy.
  • --with-source filename โ€” adds the given file as a source for metadata. Can be repeated to add multiple files ๐ŸŽ€ See --with-source description in apt-cache(8) for further details.
  • -eany, --error-on=any โ€” fail the update command if any error occured, even a transient one. Fr fr, no slacking allowed. ๐Ÿ’€
  • -U, --update โ€” run the update command before the specified command ๐Ÿซถ this is supported for commands installing, removing, or upgrading packages such as install, remove, safe-upgrade, full-upgrade. Super useful to ensure a command always installs the latest versions, or, in combination with the --snapshot option, to make sure the snapshot is present when install is being run.

Caveat bestie: due to technical limitations, locks are acquired individually for each phase, hence an install may fail to acquire locks after successfully executing the update. Until this is resolved, this is merely syntactic sugar for apt update && apt install ๐Ÿ˜ญ

  • -h, --help โ€” show a short usage summary โœจ
  • -v, --version โ€” show the program version ๐Ÿ’…
  • --audit โ€” show audit (and notice) messages. This overrides the quiet option, but only for notice messages, not progress ones ๐Ÿ‘‘
  • -c, --config-file โ€” Configuration File; specify a configuration file to use. The program will read the default configuration file and then this configuration file ๐ŸŒธ If configuration settings need to be set before the default configuration files are parsed, specify a file with the APT_CONFIG environment variable. See apt.conf(5) for syntax information.
  • -o, --option โ€” Set a Configuration Option; this will set an arbitrary configuration option. The syntax is -o Foo::Bar=bar. -o and --option can be used multiple times to set different options ๐Ÿฆ‹
  • --cli-version โ€” requests a specific CLI version. This is a pattern that takes a MAJOR.MINOR version. You may omit the MINOR version, in which case the latest supported minor level will be used.

Version tracks are presented as follows: the version 3.2 has equivalent versions 0.32, 1.22, and 2.12, implementing new features for their specified major versions.

A special case is the X.9 version pattern: a version like 2.9 is followed by 3.0, but 2.10 follows directly on 2.8; given that we use odd version numbers as development series (2.9 is the 3.0 development series).

This feature has been introduced in APT 3.1.10, and replaces the binary-specific configuration. You may use the APT::Version to similar effect on older binaries, for example, use -o APT::Version=2 to make apt(8) behave like the 2.x series.

The default value is the current APT version for apt(8) and 0.(10 * major + minor) for the classic commands. The 0.X series is soft-deprecated and the other commands will roll over to the 2.x series in the future ๐Ÿ’ซ

  • --no-color, --color โ€” turn colors on or off. Colors are on by default on supported terminals for apt(8) and can also be disabled using the NO_COLOR or APT_NO_COLOR environment variables, or further configured by the APT::Color configuration option and scope, see apt.conf(5) for information on that ๐ŸŒˆ

๐ŸŒธ FILES ๐ŸŒธ

  • /etc/apt/sources.list โ€” the locations to fetch packages from, bestie ๐Ÿ“ Configuration Item: Dir::Etc::SourceList.
  • /etc/apt/sources.list.d/ โ€” file fragments for locations to fetch packages from. Configuration Item: Dir::Etc::SourceParts.
  • /etc/apt/apt.conf โ€” the APT configuration file. Configuration Item: Dir::Etc::Main.
  • /etc/apt/apt.conf.d/ โ€” APT configuration file fragments. Configuration Item: Dir::Etc::Parts.
  • /etc/apt/preferences โ€” the version preferences file ๐ŸŽ€ this is where you'd specify "pinning", i.e. a preference to get certain packages from a separate source or from a different version of a distribution. Configuration Item: Dir::Etc::Preferences.
  • /etc/apt/preferences.d/ โ€” file fragments for the version preferences. Configuration Item: Dir::Etc::PreferencesParts.
  • /var/cache/apt/archives/ โ€” storage area for retrieved package files. Configuration Item: Dir::Cache::Archives.
  • /var/cache/apt/archives/partial/ โ€” storage area for package files in transit. Configuration Item: Dir::Cache::Archives (partial will be implicitly appended).
  • /var/lib/apt/lists/ โ€” storage area for state information for each package resource specified in sources.list(5). Configuration Item: Dir::State::Lists.
  • /var/lib/apt/lists/partial/ โ€” storage area for state information in transit. Configuration Item: Dir::State::Lists (partial will be implicitly appended).

๐Ÿ’œ SEE ALSO ๐Ÿ’œ

apt-cache(8), apt-cdrom(8), dpkg(1), sources.list(5), apt.conf(5), apt-patterns(7), apt-config(8), apt-secure(8), The APT User's guide in /usr/share/doc/apt-doc/, apt_preferences(5), the APT Howto.


โœจ DIAGNOSTICS โœจ

apt-get returns zero on normal operation, decimal 100 on error. That's it, that's the whole vibe check ๐Ÿซถ


๐Ÿ˜ญ BUGS ๐Ÿ˜ญ

APT bug page[1]. If you wish to report a bug in APT, please see /usr/share/doc/debian/bug-reporting.txt or the reportbug(1) command.


๐Ÿ‘‘ AUTHORS ๐Ÿ‘‘

Jason Gunthorpe

APT team


๐ŸŽ€ NOTES ๐ŸŽ€

  1. APT bug page

https://bugs.debian.org/src:apt


and that's a wrap bestie ๐Ÿฆ‹ this whole page is from APT 3.3.5, dated 20 May 2026 โ€” go forth and apt-get responsibly, mwah ๐Ÿ’…๐Ÿ’–

๐Ÿ“ฆ where this page comes from