1 minute read

to enable automatic updates install:

[code language="bash"]
$ apt install unattended-upgrades
[/code]

check and uncomment in the config file as needed, well documented inside the same config file /etc/apt/apt.conf.d/50unattended-upgrades:

[code language="bash" padlinenumbers="true" collapse="true" title="on raspbian"]
$ cat /etc/apt/apt.conf.d/50unattended-upgrades
Unattended-Upgrade::Origins-Pattern {
"o=Raspbian,n=jessie,l=Raspbian-Security";
};
Unattended-Upgrade::MinimalSteps "true";
Unattended-Upgrade::InstallOnShutdown "true";
Acquire::http::Dl-Limit "300";
[/code]

[code language="bash" padlinenumbers="true" collapse="true" title="on mint 18.1"]
$ cat /etc/apt/apt.conf.d/50unattended-upgrades
Unattended-Upgrade::Origins-Pattern {
"o=Ubuntu,a=xenial-security";
"o=Ubuntu,a=xenial-updates";
"o=Ubuntu,a=xenial";
"o=Canonical,a=xenial";
"o=linuxmint,n=serena";
};
Unattended-Upgrade::MinimalSteps "true";
Unattended-Upgrade::InstallOnShutdown "true";
Acquire::http::Dl-Limit "300";
[/code]

edit the config file:

[code language="bash" padlinenumbers="true" collapse="true" title="/etc/apt/apt.conf.d/10periodic"]
$ vim /etc/apt/apt.conf.d/10periodic
# update the package list
APT::Periodic::Update-Package-Lists "1";
APT::Periodic::Download-Upgradeable-Packages "1";
APT::Periodic::AutocleanInterval "7";

# once a day
APT::Periodic::Unattended-Upgrade "1";
[/code]

check if its working:

[code language="bash"]
$ sudo unattended-upgrades --dry-run
$ tail /var/log/unattended-upgrades/unattended-upgrades.log
[/code]


sources:

https://community.linuxmint.com/tutorial/view/1217

http://www.faqforge.com/linux/how-to-enable-auto-updates-in-ubuntu/