Monday, May 6, 2024
 Popular · Latest · Hot · Upcoming
77
rated 0 times [  77] [ 0]  / answers: 1 / hits: 82517  / 3 Years ago, tue, october 5, 2021, 9:47:13

I want to be sure if automatic updates are enabled on Ubuntu 12.04 server.



How exactly can I check this?



And how can I disable automatic updates if it's enabled?


More From » server

 Answers
2

There is a package that can be used to do this for you.



sudo apt-get install unattended-upgrades


or if unattended-upgrades already installed. Or you can checkout the Ubuntu docs



sudo dpkg-reconfigure -plow unattended-upgrades


That is the package you need to install. Once its installed edit the files



/etc/apt/apt.conf.d/10periodic
/etc/apt/apt.conf.d/20auto-upgrades


In that file you can set how often you want the server to update.



APT::Periodic::Update-Package-Lists "1";
APT::Periodic::Download-Upgradeable-Packages "1";
APT::Periodic::AutocleanInterval "7";
APT::Periodic::Unattended-Upgrade "1";


The file should look like that. The 1 means it will update every day. 7 is weekly.



/etc/apt/apt.conf.d/50unattended-upgrades


This files will let you chose what updates you want to make by choosing where apt can search for new updates and upgrades. ( My personal opinion on this is I would set it to security if this is a server )



Unattended-Upgrade::Allowed-Origins {
"${distro_id}:${distro_codename}-security";
// "${distro_id}:${distro_codename}-updates";

};


The variables ${distro_id} and ${distro_codename} are expanded automatically. I would comment out the updates entry and just leave security.


[#36353] Wednesday, October 6, 2021, 3 Years  [reply] [flag answer]
Only authorized users can answer the question. Please sign in first, or register a free account.
errettas

Total Points: 160
Total Questions: 118
Total Answers: 91

Location: Laos
Member since Fri, Sep 11, 2020
4 Years ago
;