Comment 7 for bug 1773033

Revision history for this message
Balint Reczey (rbalint) wrote : Re: unattended upgrade no longer actions on shutdown

Tested 1.1ubuntu1.18.04.4 and it worked as expected.

Log:
rbalint@yogi:~$ sudo unattended-upgrade --dry-run --verbose
Initial blacklisted packages:
Initial whitelisted packages:
Starting unattended upgrades script
Allowed origins are: o=Ubuntu,a=bionic, o=Ubuntu,a=bionic-security, o=UbuntuESM,a=bionic
No packages found that can be upgraded unattended and no pending auto-removals

# here i put the laptop on battery

rbalint@yogi:~$ sudo unattended-upgrade --dry-run --verbose
Initial blacklisted packages:
Initial whitelisted packages:
Starting unattended upgrades script
Allowed origins are: o=Ubuntu,a=bionic, o=Ubuntu,a=bionic-security, o=UbuntuESM,a=bionic
System is on battery power, stopping
rbalint@yogi:~$ sudo vi /etc/apt/apt.conf.d/51unattended-upgrades-on-battery
rbalint@yogi:~$ cat /etc/apt/apt.conf.d/51unattended-upgrades-on-battery
Unattended-Upgrade::OnlyOnACPower "false";
rbalint@yogi:~$ on_ac_power ; echo $?
1
rbalint@yogi:~$ sudo unattended-upgrade --dry-run --verbose
Initial blacklisted packages:
Initial whitelisted packages:
Starting unattended upgrades script
Allowed origins are: o=Ubuntu,a=bionic, o=Ubuntu,a=bionic-security, o=UbuntuESM,a=bionic
No packages found that can be upgraded unattended and no pending auto-removals
rbalint@yogi:~$ dpkg -l unattended-upgrades | cat
Desired=Unknown/Install/Remove/Purge/Hold
| Status=Not/Inst/Conf-files/Unpacked/halF-conf/Half-inst/trig-aWait/Trig-pend
|/ Err?=(none)/Reinst-required (Status,Err: uppercase=bad)
||/ Name Version Architecture Description
+++-===================-==================-============-===========================================
ii unattended-upgrades 1.1ubuntu1.18.04.4 all automatic installation of security upgrades