A trick in Ubuntu.

x package can be updated

Recently I get this message when log into the system.

    x packages can be updated.
    y updates are security updates.

Ummm, the “You have X app to update” hint.
It should be done with this command I think:

    apt-get update
    apt-get upgrade

But seems this update&&upgrade command does nothing:

    x packages can be updated.
    y updates are security updates.

After I google,
I get to know that update + upgrade can’t do the whole upgrade.
We need one more command:

    apt-get dist-upgrade

So we can get rid of this little annoying hint.

MOTD

When log in, this Ubuntu message is named
MOTD(Message of the day).
Many company SA would customize their server’s MOTD.

MOTD scripts are put under /etc/update-motd.d by default in Ubuntu.
The x packages can be updated message was generated by
the script /etc/update-motd.d/90-updates-available.

So if you want to totally remove the ‘update packages’ message,
you can delete the file /etc/update-motd.d/90-updates-available.
(Not recommended.)

We can also customize our MOTD.
(By putting shell scripts under /etc/update-motd.d)

Conclusion

  1. Update all packages command in Ubuntu is aptget update && apt-get upgrade && apt-get dist-upgrade.

  2. We have MOTD for displaying message when log in, which is put under /etc/update-motd.d.