Signup/Sign In
Ask Question
Not satisfied by the Answer? Still looking for a better solution?

How to install updates via command line?

When I log into my webserver via SSH I see the information:
88 packages can be updated.
80 updates are security updates


I tried apt-get update then apt-get upgrade but each time I log in I still see the message about updates. How do I install them?
by

3 Answers

akshay1995
Use this:

sudo apt update # Fetches the list of available updates
sudo apt upgrade # Installs some updates; does not remove packages
sudo apt full-upgrade # Installs updates; may also remove some packages, if needed
sudo apt autoremove # Removes any old packages that are no longer needed

Documentation about each apt option can be found in the the manpages for apt. These are also available by running man apt in your terminal.

Use of both upgrade and full-upgrade together is usually not needed, but it may help in some cases
RoliMishra
In my case, I had an incorrect or not accessible URL in /etc/apt/sources.list. After removing this URL, I was able to update all packages successfully.

Commands:

sudo vi /etc/apt/sources.list
sudo apt-get update && sudo apt-get upgrade
pankajshivnani123
This is normal behavior.

The message you see on login has been appended to the server status 'Message-Of-The-Day', which is only updated each calendar day (or on server boot / startup). Have a look at the contents, using

cat /etc/motd

Still seeing the same updates available, after running

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

is to be expected. If you then re-run this command you will only be prompted for any further updates if even further (newer) updates have been released.

Login / Signup to Answer the Question.