20

I have a 16.04 server on Digital Ocean that lists this when I ssh into it...

 * Documentation:  https://help.ubuntu.com
 * Management:     https://landscape.canonical.com
 * Support:        https://ubuntu.com/advantage

7 packages can be updated.
7 updates are security updates.

I have run apt-get update and apt-get upgrade many times and it has not gone away.

After I run the upgrade I see this as the last line...

0 upgraded, 0 newly installed, 0 to remove and 4 not upgraded.
Joff
  • 504
  • 2
  • 6
  • 15
  • 5
    I recommend using apt instead of apt-get, as it deals with such situations more intelligently (in particular, sudo apt upgrade would have upgraded those four packages). – fkraiem Dec 09 '16 at 00:49

4 Answers4

24

Since your using ubuntu 16.04 the following should fix it:

sudo apt full-upgrade

But if you prefer the Ubuntu 14.04 way then:

sudo apt-get dist-upgrade

If the two commands don't work you should talk to digital ocean about it.

Hope that helps.

George Udosen
  • 36,677
6

It is possible your /var/lib/update-notifier/updates-available file did not refresh after your last update.

If you want to set this manually:

sudo su # Needed to acquire permissions.
/usr/lib/update-notifier/apt-check --human-readable >/var/lib/update-notifier/updates-available
exit    # to get out of sudo

Note that /var/lib/update-notifier/updates-available is set with 0600 for permissions for the user & group 'root', which prevent you from simply sudo-ing the apt-check command to rewrite it.

  • 2
    It’s not the 600, but bash syntax. apt-check does’t need permission; the > does. Try replacing > with | sudo tee to verify. – Franklin Yu Jul 25 '18 at 02:52
  • This was the only working answer for me. Byobu was saying i had 1400+ upgradable packages, and apt list --installed indicated the same. Apt upgrade said 0 upgrades available. – unixandria Feb 12 '20 at 20:20
  • sudo /usr/lib/update-notifier/apt-check --human-readable | sudo tee /var/lib/update-notifier/updates-available && sudo apt -y update && sudo apt -y dist-upgrade && sudo apt -y autoremove – uav Apr 14 '21 at 17:43
  • I'd check this and update my answer, but I can't... I can update the answer, but I can't check that it works, as I lack a system with this problem at the moment. – Joseph Van Riper Apr 18 '21 at 13:00
  • I don't have a /usr/lib/update-notifier directory. :-/ – Aaron Jensen Apr 24 '21 at 00:47
6

Use the dist-upgrade command, which will perform upgrades that require changing dependencies, adding or removing new packages if necessary. This will handle a set of upgrades which may have been kept back by apt-get upgrade:

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

For more information see What is "dist-upgrade" and why does it upgrade more then "upgrade" ?

Liso
  • 15,377
  • 3
  • 51
  • 80
2

First of all the message

0 upgraded, 0 newly installed, 0 to remove and 4 not upgraded.

says that there are 4 packages not upgraded. I guess these are related to a newer kernel and can be upgraded with

apt-get full-upgrade 

Besides that the message

7 packages can be updated.
7 updates are security updates.

is not calculated every time you login so it might be outdated.

jsalatas
  • 411
  • 1
    Is there a way I can force it to update? It used to clear everytime I updated the system and this time it has been stuck for over a week – Joff Dec 09 '16 at 01:06
  • I'm afraid I don't know the answer to this :( – jsalatas Dec 09 '16 at 01:13
  • sudo apt full-apgrade is the safest way to update what's available. If that doesn't help, one or more packages may be held back due to unmet dependendices. Normally that fixes itself in a few days. – Gunnar Hjalmarsson Dec 09 '16 at 02:37