To set up automatic updates for Ubuntu 18.04, follow these steps:
unattended-upgrades
package:sudo apt-get update sudo apt-get install unattended-upgrades
/etc/apt/apt.conf.d/50unattended-upgrades
file in a text editor and uncomment the following line:"${distro_id}:${distro_codename}-updates";
This will enable automatic installation of security updates.
"${distro_id}:${distro_codename}-security"; "${distro_id}:${distro_codename}";
Save and close the file.
To configure the frequency of updates, open the /etc/apt/apt.conf.d/20auto-upgrades
file in a text editor and modify the APT::Periodic::Update-Package-Lists
and APT::Periodic::Unattended-Upgrade
options. For example, to check for updates daily and install them automatically:
APT::Periodic::Update-Package-Lists "1"; APT::Periodic::Unattended-Upgrade "1";
Automatic updates will now be enabled and configured according to the specified frequency and scope. For more information about configuring automatic updates in Ubuntu, see the unattended-upgrades
documentation.