17
I want my Ubuntu server to automatically install security updates. How do I configure unattended-upgrades?
Loading...
Q&A · Answered
I want my Ubuntu server to automatically install security updates. How do I configure unattended-upgrades?
Accepted answer
sudo apt install unattended-upgrades
sudo dpkg-reconfigure -plow unattended-upgrades
# Edit /etc/apt/apt.conf.d/50unattended-upgrades
Unattended-Upgrade::Allowed-Origins {
"${distro_id}:${distro_codename}-security";
};
Unattended-Upgrade::Automatic-Reboot "true";
Unattended-Upgrade::Automatic-Reboot-Time "02:00";
# Edit /etc/apt/apt.conf.d/20auto-upgrades
APT::Periodic::Update-Package-Lists "1";
APT::Periodic::Unattended-Upgrade "1";Say what you tried, not only what worked — the next person needs the reasoning. Code goes in a fenced block.