Sudo apt upgrade or sudo apt dist upgrade

I use sudo apt dist upgrade probably because of laziness and cannot be bothered to look at the packages before deciding which one to use, never had a problem.

  • Sudo apt upgrade
  • Sudo apt dist upgrade
0 voters

upgrade and dist-upgrade apt options behave differently. I do not use them interchangeably.

According to man pages

    upgrade
           upgrade is used to install 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; under no
           circumstances are currently installed packages removed, or packages not already
           installed retrieved and installed. New versions of currently installed packages that
           cannot be upgraded without changing the install status of another package will be left
           at their current version. 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 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.

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

I don't see the reason for a poll; but personally my default is apt full-upgrade (closest to apt-get dist-upgrade)

The command I use to upgrade on this box is actually

snap refresh; apt update; apt autoremove ; apt autoclean ; apt full-upgrade ; neofetch

I always read what change(s) will be made; and include apt autoremove; apt autoclean as if packaging mistakes were made (installed packages are no longer required dependencies. and thus will be removed) I'd rather see that change now when the change is new (super easy to find why it was made) & I can see if its expected, or a problem (packaging rule changes have been in error before).

Do note I'm on the development release (currently plucky) thus there are more cases where an apt full-upgrade is required when compared to a stable release; and if using a production server my behavior would differ (esp. if a server I wasn't familiar with when compared with this desktop system)

4 Likes

Also missing from the poll is the Ubuntu Mate 'Software Updater'.
I believe software updater uses dist-upgrade as if there is a new kernel it will upgrade the kernel.
As for upgrade or dist-upgrade both do the same thing, but dist-upgrade does a bit more, like updating the kernel and replacing the packages affected by that.

2 Likes

I do not dispute your opinion, but according to my experience apt upgrade upgrades kernel as well as other packages. Probably that is due to linux-generic and linux-image-generic metapackages which "... depend on the latest complete generic Linux kernel and headers."

I don't dispute your opinion either. What I meant is if you use dist-upgrade and there is nothing more to upgrade it just does upgrade. I would know when it said 'some packages held back' and then listed the new kernel and packages to be upgraded. Unless you have a reason to not upgrade the kernel then there is no harm in using dist-upgrade all the time. Now if for some reason you don't want those packages updated, plain upgrade would have to be used.

2 Likes

A bit of fun, that's all, thanks for voting jymm

1 Like