It is recommended for all the Linux system users to keep packages up to date. All the Linux distribution’s provides security and packages upgrades time to time. You must keep the Ubuntu packages updated.
This tutorial will help you to update latest packages on a Ubuntu system. You can also apply only security updates silently via command line.
Update Ubuntu Packages
Fetch the update for all your repositories for all your apps to all the latest updates lists.
sudo apt update
Then run the upgrade command to upgrade all the packages to latest available versions.
sudo apt upgrade
Now, run the
dist-upgrade which intelligently handles changing dependencies with new versions of packages. It also removes obsolete packages form your system.
sudo apt dist-upgrade
Apply Security Updates Only
You may don’t like to update all the packages on your Ubuntu system. But we still recommend you to apply security updates on your systems. This upgrades are highly recommended for the production system to keep them secure.
Use the unattended upgrade to silently install updates without user interaction on your Ubuntu system.
sudo apt install unattended-upgrades
But, if you want to run an interactive installation or upgrade use (-d) display parameter.
sudo apt install unattended-upgrades -d