34

In accordance with man pages:

  • apt has parameter full-upgrade
  • apt-get has parameter dist-upgrade.

Are both the same command?

btw: which is officially the recommended command in Ubuntu 16.04? apt or apt-get?

23

apt full-upgrade performs the same function as apt-get dist-upgrade.

man apt

   full-upgrade (apt-get(8))
       full-upgrade performs the function of upgrade but will remove currently installed packages if this is needed to upgrade the system as a whole.

man apt-get

   dist-upgrade
       dist-upgrade in addition to performing the function of upgrade, 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. The dist-upgrade command may therefore remove some packages. The
       /etc/apt/sources.list file contains a list of locations from which to retrieve desired package files. See also apt_preferences(5) for a mechanism for overriding the general settings for
       individual packages.
  • 3
    Why create confusion with a new name that does the same thing? You can do either apt dist-upgrade (I just tried it) or you can do apt full-upgrade and you are saying they do the same thing. – Z boson Jan 24 '17 at 20:56
  • 6
    "full-upgrade" is about removing installed packages when necessary, while "dist-upgrade" is about "intelligently handling changing dependencies with new versions of packages", how is it the same function ? – Tristan Jan 25 '17 at 12:06
  • 3
  • 3
    It's the same function. It's just an alias in apt for the apt-get command. sources.debian.org/src/apt/1.6.1/cmdline/apt.cc/?hl=74#L74 (the actual macro invoked seems to be missing from the repo though). – Iain Collins May 14 '18 at 0:44
  • 2
    @Zboson The reason for the new name is that the "dist-upgrade" name was itself extremely confusing for many users: while it was named that because it was something you needed when upgrading between distribution releases, it sounded too much as though it was only for use in that circumstance, whereas in fact it's much more broadly applicable. – Colin Watson May 19 at 23:17
1

apt and apt-get are two different commands. apt is the newer command and should be used as default. You should change to using apt over apt-get as apt is better.

  • 1
    Why/how is it better? – mafrosis Jul 10 at 10:29
0

Apt is the newer version of the command. You should switch to using apt instead of apt-get its better and gives better idea of what the command is doing.

As for apt-full-upgrade and apt-get-dist its the same command. But again apt is the newer command.

For example when using apt you get a progress bar to tell you how much of the install/update is done.

0

Use apt as a first choice, but if you're scripting use apt-get. Apt-get has more stable output (meaning that the output format is left alone as much as possible so as not to break scripts which parse that output automatically). Apt-get also has some low-level commands not available in apt.

The manual pages for apt and apt-get describe full-upgrade and dist-upgrade a little differently, but they are probably the same command (apt accepts dist-upgrade as an alias of full-upgrade). This serves as a good example of apt-gets stability. In apt, the name was changed to be more user friendly, while in apt-get the name remains unchanged so as not to break compatibility with old scripts.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.