This guide will help you to install updates on your Ubuntu system. This also helps you to apply security updates silently on your Ubuntu systems.
Packages Updates on Ubuntu Command-Line
Fetch the update for all your repositories for all your apps to all the latest updates lists.
sudo apt-get update
Then run the upgrade command to upgrade all the packages to latest available versions.
sudo apt-get upgrade
Now run dist-upgrade which intelligently handles changing dependencies with new versions of packages. It also removes obsolete packages form your system.
sudo apt-get dist-upgrade
Apply security updates only
Many times you need to apply security updates only for example on production systems. You can use the unattended upgrade command to silently install updates without user interaction on your Ubuntu system.
sudo apt-get install unattended-upgrades
But, if you want to run an interactive installation or upgrade use (-d) display parameter.
sudo apt-get install unattended-upgrades -d