Skip to content

Instantly share code, notes, and snippets.

@Refalm
Created June 19, 2023 20:00
Show Gist options
  • Save Refalm/efaea50b1445f8417df0db662f456e60 to your computer and use it in GitHub Desktop.
Save Refalm/efaea50b1445f8417df0db662f456e60 to your computer and use it in GitHub Desktop.
Debian automatic updates
apt update && apt upgrade -y && apt autoremove -y && apt install -y unattended-upgrades && echo -e "APT::Periodic::Update-Package-Lists \"1\";\nAPT::Periodic::Unattended-Upgrade \"1\";\n" > /etc/apt/apt.conf.d/20auto-upgrades && echo -e "Dpkg::Options {\n\t\"--force-confdef\";\n\t\"--force-confold\";\n}\n" > /etc/apt/apt.conf.d/local && echo -e 'Unattended-Upgrade::Origins-Pattern {\n\t"origin=Debian,codename=${distro_codename}-updates";\n\t"origin=Debian,codename=${distro_codename},label=Debian";\n\t"origin=Debian,codename=${distro_codename},label=Debian-Security";\n\t"origin=Debian,codename=${distro_codename}-security,label=Debian-Security";\n};\n\nUnattended-Upgrade::Package-Blacklist {\n};\n\nUnattended-Upgrade::AutoFixInterruptedDpkg "true";\nUnattended-Upgrade::Remove-Unused-Kernel-Packages "true";\nUnattended-Upgrade::Remove-New-Unused-Dependencies "true";\nUnattended-Upgrade::Remove-Unused-Dependencies "true";\nUnattended-Upgrade::Automatic-Reboot "true";\nUnattended-Upgrade::Automatic-Reboot-WithUsers "true";' > /etc/apt/apt.conf.d/50unattended-upgrades && systemctl restart unattended-upgrades.service
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment