I came to the conclusion that to manually control unattended upgrades it currently the "easiest" (sarcasm tag on) way to only let the timer update your package list and manually run unattended-upgrades via cron at your desired time.
Ubuntu:
#######
// Unattended-Upgrade::Origins-Pattern controls which packages are
// upgraded.
Unattended-Upgrade::Origins-Pattern {
"origin=Ubuntu,archive=${distro_codename}-security";
//"o=Ubuntu,a=${distro_codename}";
//"o=Ubuntu,a=${distro_codename}-updates";
//"o=Ubuntu,a=${distro_codename}-proposed-updates";
};
// List of packages to not update (regexp are supported)
Unattended-Upgrade::Package-Blacklist {
};
// Do automatic removal of new unused dependencies after the upgrade
// (equivalent to apt-get autoremove)
Unattended-Upgrade::Remove-Unused-Dependencies "true";
// Automatically reboot *WITHOUT CONFIRMATION* if a
// the file /var/run/reboot-required is found after the upgrade
//Unattended-Upgrade::Automatic-Reboot "true";
// Use apt bandwidth limit feature, this example limits the download
// speed to 70kb/sec
//Acquire::http::Dl-Limit "70";
Acquire::http::Dl-Limit "350";
Debian:
#######
// Unattended-Upgrade::Origins-Pattern controls which packages are
// upgraded.
Unattended-Upgrade::Origins-Pattern {
"origin=Debian,codename=${distro_codename},label=Debian-Security";
//"o=Debian,codename=${distro_codename},label=Debian";
//"o=Debian,codename=${distro_codename},a=proposed-updates";
};
// List of packages to not update (regexp are supported)
Unattended-Upgrade::Package-Blacklist {
};
// Do automatic removal of new unused dependencies after the upgrade
// (equivalent to apt-get autoremove)
Unattended-Upgrade::Remove-Unused-Dependencies "true";
// Automatically reboot *WITHOUT CONFIRMATION* if a
// the file /var/run/reboot-required is found after the upgrade
//Unattended-Upgrade::Automatic-Reboot "true";
// Use apt bandwidth limit feature, this example limits the download
// speed to 70kb/sec
//Acquire::http::Dl-Limit "70";
Acquire::http::Dl-Limit "350";
I came to the conclusion that to manually control unattended upgrades it currently the "easiest" (sarcasm tag on) way to only let the timer update your package list and manually run unattended-upgrades via cron at your desired time.
To do so:
# apt-get install unattended-upgrades update- notifier- common
# rm /etc/apt/ apt.conf. d/20auto- upgrades /etc/apt/ apt.conf. d/10periodic unattended- upgrades/ *
# rm /var/log/
# vi /etc/apt/ apt.conf. d/20auto- upgrades
APT::Periodic: :Update- Package- Lists "1"; :Unattended- Upgrade "0";
APT::Periodic:
# vi /etc/apt/ apt.conf. d/local
Dpkg::Options { confdef" ; confold" ;
"--force-
"--force-
}
# vi /etc/apt/ apt.conf. d/50unattended- upgrades
(Thanks to ansible-role at https:/ /github. com/jnv/ ansible- role-unattended -upgrades)
Ubuntu: Upgrade: :Origins- Pattern controls which packages are Upgrade: :Origins- Pattern { origin= Ubuntu, archive= ${distro_ codename} -security" ; /"o=Ubuntu, a=${distro_ codename} "; /"o=Ubuntu, a=${distro_ codename} -updates" ; /"o=Ubuntu, a=${distro_ codename} -proposed- updates" ;
#######
// Unattended-
// upgraded.
Unattended-
"
/
/
/
};
// List of packages to not update (regexp are supported) Upgrade: :Package- Blacklist {
Unattended-
};
// Do automatic removal of new unused dependencies after the upgrade Upgrade: :Remove- Unused- Dependencies "true";
// (equivalent to apt-get autoremove)
Unattended-
// Automatically reboot *WITHOUT CONFIRMATION* if a reboot- required is found after the upgrade Upgrade: :Automatic- Reboot "true";
// the file /var/run/
//Unattended-
// Use apt bandwidth limit feature, this example limits the download :http:: Dl-Limit "70"; :http:: Dl-Limit "350";
// speed to 70kb/sec
//Acquire:
Acquire:
Debian:
#######
// Unattended- Upgrade: :Origins- Pattern controls which packages are Upgrade: :Origins- Pattern { origin= Debian, codename= ${distro_ codename} ,label= Debian- Security" ; /"o=Debian, codename= ${distro_ codename} ,label= Debian" ; /"o=Debian, codename= ${distro_ codename} ,a=proposed- updates" ;
// upgraded.
Unattended-
"
/
/
};
// List of packages to not update (regexp are supported) Upgrade: :Package- Blacklist {
Unattended-
};
// Do automatic removal of new unused dependencies after the upgrade Upgrade: :Remove- Unused- Dependencies "true";
// (equivalent to apt-get autoremove)
Unattended-
// Automatically reboot *WITHOUT CONFIRMATION* if a reboot- required is found after the upgrade Upgrade: :Automatic- Reboot "true";
// the file /var/run/
//Unattended-
// Use apt bandwidth limit feature, this example limits the download :http:: Dl-Limit "70"; :http:: Dl-Limit "350";
// speed to 70kb/sec
//Acquire:
Acquire:
# vi /opt/unattended -upgrade- manual. sh
#!/bin/bash
sleep $((RANDOM \% 1800))
apt-get update
unattended-upgrade -d
apt-get -y clean
# chmod +x /opt/unattended -upgrade- manual. sh
# vi /etc/cron. d/unattended- upgrade
SHELL=/bin/bash local/sbin: /usr/local/ bin:/sbin: /bin:/usr/ sbin:/usr/ bin -upgrade- manual. sh
PATH=/usr/
30 03 * * * root /opt/unattended
Fuck the systemd-timers, fuck cron.daily - I'm in charge... :P
Improvements are welcome.
Best regards
Florian