How do I see what updates are a available in the terminal

I have a server running Ubuntu 16, how do I find out what are the security updates and apply them?

How to choose the ones I want?

How do I know if they will not interfere with running app?

Thanks


Solution 1:

You can run

sudo apt update && apt list --upgradable

That will first update the package list and then show available upgrades.

Solution 2:

Try the following:

sudo apt-get update        # Fetches the list of available updates
sudo apt-get upgrade       # Strictly upgrades the current packages
sudo apt-get dist-upgrade  # Installs updates (new ones)

If you want to see the sources where your updated are coming from run the following:

sudo vi /etc/apt/sources.list

Alternatively, under Ubuntu, open the Ubuntu Software Center and click the Updates tab, and it will display everything that can be updated inside the GUI.