Ubuntu – Is using Software Updater the same thing as running apt-get update and apt-get upgrade

aptupdate-manager

It seems like this should be true but I wanted to make sure. Thanks!

Best Answer

Short answer

No, they are not the same. apt-get upgrade doesn't handle changing dependencies between versions, so if a package has changed dependencies, it wont be upgraded (it'll be "held back"). See the long answer for more details.

Using the Software Updater and using sudo apt-get update ; sudo apt-get dist-upgrade (note the dist-) would be almost equivalent, except that one's obviously a GUI and the other's a console application and also a few very minor informational differences.


Long asnwer

From man apt-get,

  • apt-get upgrade:

    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.

    (emphasis by me)

    This means that a newer version of a package which has a new dependency not required in the old version will not be upgraded with this method (unless the new dependency was already installed). These will be shown as "Held back".

  • apt-get dist-upgrade:

    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.

    (emphasis by me)

    This means that with this command instead of upgrade, packages with new (or removed) dependencies can by upgraded.

Example

A good example of the difference between the two is when a new Linux kernel is released. This is packaged into the linux-image-generic package which always depends on the latest package of the Linux kernel. Because the dependencies of linux-image-generic change with each kernel upgrade, upgrade wont upgrade it.