8

I have always been running the following command to update via terminal my machines:

sudo apt-get update && sudo apt-get upgrade -y

But the other day, right after having finished installing some updates, the Update Manager popped up asking me to install some updates. I was puzzled as I have always thought the two were equivalent. I tried running the terminal command again: no updates. Then tried pressing the "Check" button on Update Manager: again some updates were available.

My conclusion is that the command above is not equivalent to the Update Manager, as I have always thought. So, what is the true equivalent terminal command of Update Manager?

1
  • 1
    Maybe dist-upgrade
    – jasmines
    May 23, 2012 at 10:51

2 Answers 2

10

You can use this command:

sudo apt-get dist-upgrade

man page says:

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. So, dist-upgrade command may 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.

7
  • But, i successfully updated Linux Kernal Image with dist-upgrade, which can not be updated with upgrade
    – dixoncx
    May 23, 2012 at 11:37
  • that's true, I forgot about that since I usually compile my own kernels :)
    – ish
    May 23, 2012 at 11:40
  • -1, -y should never be used. It has the potential to break poorly made packages that require dealing with system-wide configs.
    – jrg
    May 23, 2012 at 11:54
  • Thats true.. But nornally it will skip the prompt Do you want to continue [Y/n]?
    – dixoncx
    May 23, 2012 at 12:36
  • I edited and removed -y :)
    – dixoncx
    May 23, 2012 at 12:38
5

apt-get will NOT consider "suggested" packages as updates, while Update Manager does. It Update Manager also includes packages which apt-get would only install/upgrade with dist-upgrade. Additionally, I believe Update Manager maintains its own package cache which is only automatically updated daily and thus may not always be synchronized with the APT package cache.

To really check if you're missing out on updates, check the version of non-recommended updates Update-Manager wants you to install, and then do a dpkg --list | grep -i packagename to find out which version of the package is really installed on your system.

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .