To update installed packages for security on Ubuntu 22.04 or 20.04, you can use the following steps:
sudo apt updateSource:www.lautturi.com
This will update the package manager's list of available packages and their versions.
unattended-upgrades
package, which automatically installs security updates for you:sudo apt install unattended-upgrades
/etc/apt/apt.conf.d/50unattended-upgrades
file and setting the Unattended-Upgrade::Automatic-Reboot
option to true
. For example:Unattended-Upgrade::Automatic-Reboot "true";
sudo unattended-upgrade -d
This will download and install any security updates that are available for your system.
Keep in mind that it is always a good idea to make a backup of your system before installing updates, in case anything goes wrong.
Alternatively, you can use the apt
command to manually install security updates. To do this, run the following command:
sudo apt upgrade
This will install all available updates for your system, including security updates.