Installing updates using the command line from the Terminal is done by using the apt update and upgrade commands. For those who aren’t aware of it, check the step-by-step tutorial we published earlier.
The apt update and upgrade command installs all the updates, including the software updates and the official security updates. If you only want to install just the security updates and not all the application updates, you can do that too. Here is how:
Installing just the security updates in Ubuntu and derivatives
This tutorial is tested on Ubuntu 18.04 but should work without any issues in other Ubuntu derivatives, including Linux Mint, elementary OS, and others.
Step 1) Launch the Terminal.
Step 2) You can check if any security updates are available by using the following command. Note that the following command doesn’t install anything. It’s a dry run simulating what is going to happen.
sudo unattended-upgrade --dry-run -d
Note the usage of the dry run. It means the update check is only a simulation. Nothing will be downloaded or installed. -d is used to display the result in the terminal.
Step 3) In the above command, if you see “No packages found that can be upgraded unattended and no pending auto-removals” in the Terminal, this implies your PC is up-to-date. If you see updates available, you can install them by using the below command:
sudo unattended-upgrade -d
That’s it! I hope you learned something new today at FOSS Linux. Have a good one.