Skip to content

Instantly share code, notes, and snippets.

@nexus166
Created August 26, 2020 23:29
Show Gist options
  • Save nexus166/47eb300c02cdd5243c725b8468e85f55 to your computer and use it in GitHub Desktop.
Save nexus166/47eb300c02cdd5243c725b8468e85f55 to your computer and use it in GitHub Desktop.

install packages

apt install unattended-upgrades apt-config-auto-update

configure

cat <<'EOF' | tee /etc/apt/apt.conf.d/50unattended-upgrades
Unattended-Upgrade::Origins-Pattern {
        "origin=Debian,codename=${distro_codename},label=Debian";
        "origin=Debian,codename=${distro_codename},label=Debian-Security";
};
Unattended-Upgrade::Remove-Unused-Dependencies "true";
Unattended-Upgrade::Automatic-Reboot "false";
Unattended-Upgrade::Automatic-Reboot-Time "04:00";
EOF

cat <<'EOF' | tee /etc/apt/apt.conf.d/10periodic
APT::Periodic::Update-Package-Lists "1";
APT::Periodic::Download-Upgradeable-Packages "1";
APT::Periodic::AutocleanInterval "7";
APT::Periodic::Unattended-Upgrade "1";
EOF

systemctl daemon-reload
systemctl enable unattended-upgrades.service
systemctl start unattended-upgrades.service
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment