"apt Versus apt-get" and "upgrade Versus dist-upgrade"

This page will de-mystify the available apt and apt-get possibilities you can choose when you want to bring your Debian/Ubuntu/Mint computer up-to-date (and probably others as well). There's a lot of misleading and/or confusing information about using apt and apt-get to upgrade your system. It's sorted out here.

I investigated the various choices thoroughly when I wrote my Ubuntu Update Script that chooses the best option available automatically. The script chooses The Right Thing To Do every time.

Three possibilities

The choices boil down to these three possibilities, in order of preference:

Possibility #1: Upgrade your packages and allow new packages to be added in order to resolve package conflicts. apt upgrade and apt-get upgrade --with-new-pkgs do this.

Possibility #2: Upgrade your packages and allow new packages to be added and possibly removed in order to resolve package conflicts. apt-get dist-upgrade and apt full-upgrade do this.

Possibility #3: Only upgrade your currently-installed packages. apt-get upgrade does this.

So, in other words, you have these...

  • apt upgrade
  • apt-get upgrade --with-new-pkgs
  • apt full-upgrade
  • apt-get dist-upgrade
  • apt-get upgrade (without the --with-new-pkgs parameter)

...that do this:

apt upgrade and apt-get upgrade --with-new-pkgs
New packages may be added to satisfy dependencies and existing packages will never be removed. Requires APT 1.0 or greater.
apt full-upgrade and apt-get dist-upgrade
Upgrades installed packages, adds packages to satisfy dependencies, and may remove packages that are no longer required according to the packaging system.
apt-get upgrade (without the --with-new-pkgs parameter)
Only upgrades currently installed packages. By default this option will not add new packages (even if they are dependencies) or remove packages (even if they are no longer required and could be removed safely).
Note: On some systems, apt-get upgrade does not have a --with-new-pkgs parameter available.

The middle possibility seems the most misunderstood. apt full-upgrade and apt-get dist-upgrade intelligently handle changing dependencies that are introduced with new versions of packages. New packages may be added or removed in order to resolve package conflicts, which seems off-putting. In fact, this is nearly always safe except in rare cases, for example if you compile your own software (that requires a dependency the package system doesn't know about) or you have made unusual customizations to your package system.

I frequently update dissimilar systems that have varying capabilities, so I wrote the update script to automate the process without having to remember individual system capabilities.

Page last modified on May 30, 2017
Powered by PmWiki