Take the 2-minute tour ×
Server Fault is a question and answer site for professional system and network administrators. It's 100% free, no registration required.

Possible Duplicate:
updates in amazon-ec2 ubuntu 10.04 server

When I log into an Ubuntu 10.04.2 LTS server, I see the message:

42 packages can be updated.
18 updates are security updates.

But when I try to update this, nothing gets upgraded as would be expected:

$ sudo apt-get update
....snip....
Reading package lists... Done
$ sudo apt-get upgrade
Reading package lists... Done
Building dependency tree
Reading state information... Done
The following packages have been kept back:
  linux-generic-pae linux-headers-generic-pae linux-image-generic-pae
0 upgraded, 0 newly installed, 0 to remove and 3 not upgraded.

Any ideas why either nothing was updated, or why the count of 3 (from apt-get) is different than 42? What software says 42 if not apt?

(Other details: This is the server edition, no GUI; I haven't touched the apt configuration files; when I installed the software, I declined to allow automatic updates)

share|improve this question

marked as duplicate by Chopper3 May 2 '11 at 10:20

This question has been asked before and already has an answer. If those answers do not fully address your question, please ask a new question.

1  
@Chopper3: Though is true that this answer is really closed to the one spotted as duplicate, I cannot see how the OP may know that the command aptitude is related to this question. Aptitude is not installed by default in latest ubuntu servers so the answer should focused in how to solve it using apt-get not aptitude (which is the tool proposed in the other post and have to be installed previously in order to solve this issue) lists.ubuntu.com/archives/maverick-changes/2010-June/… -> aptitude removed from standard –  hmontoliu May 2 '11 at 11:00
    
A number of people asked for it to be closed as duplicate, I have no particular opinion on the question. SF is a democracy if enough people want a question closed then it is, same for if enough people want it reopened. –  Chopper3 May 2 '11 at 11:20

3 Answers 3

up vote 5 down vote accepted

This message is coming from the MOTD (message of the day) system. Details of how to fix the incongruity between this message and the package manager were covered recently in this answer.

share|improve this answer
    
sudo rm /etc/motd.tail did the trick –  Mike T May 2 '11 at 10:57
    
but that doesn't upgrade your system :-) –  hmontoliu May 2 '11 at 11:05
    
The above was preceded by sudo apt-get update && sudo apt-get dist-upgrade, however that didn't change the message text. I had to delete the tail file and restart, and now I correctly see "0 packages can be updated" –  Mike T May 2 '11 at 18:46

In order to install packages kept back you have to run:

sudo apt-get update && sudo apt-get dist-upgrade

Trying to run just sudo apt-get update && sudo apt-get upgrade wont install packages kept back because apt-get upgrade by default does not try to install new packages (such as new kernel versions); from the man page: under no circumstances are currently installed packages removed, or packages not already installed retrieved and installed.

However apt-get dist-upgrade allows you to install new packages when needed (ie, a new kernel version); From the man page:

  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.
share|improve this answer
2  
This did update the three packages, but it did not change the MOTD message which read exactly the same as before ("42 packages can be updated..."). I had to manually reset this message via sudo rm /etc/motd.tail, and now I correctly see "0 packages can be updated". –  Mike T May 2 '11 at 18:50

sudo apt-get upgrade

It should work out for ya, cheers boddy

share|improve this answer

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