Tested 1.1ubuntu1.18.04.4 and it worked as expected.

Log:

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
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 metered connection, stopping
rbalint@yogi:~$  nmcli -t -f GENERAL.DEVICE,GENERAL.METERED dev show `ip route 
list 0/0 | sed -r 's/.*dev (\S*).*/\1/g'`
GENERAL.DEVICE:wlp4s0
GENERAL.METERED:yes (guessed)
rbalint@yogi:~$ lxc shell bb-uu11ubuntu118041 
mesg: ttyname failed: No such device
root@bb-uu11ubuntu118041:~# sudo apt install 
./unattended-upgrades_1.1ubuntu1.18.04.4_all.deb 
Reading package lists... Done
Building dependency tree       
Reading state information... Done
Note, selecting 'unattended-upgrades' instead of 
'./unattended-upgrades_1.1ubuntu1.18.04.4_all.deb'
The following package was automatically installed and is no longer required:
  libfreetype6
Use 'sudo apt autoremove' to remove it.
Suggested packages:
  bsd-mailx default-mta | mail-transport-agent needrestart
The following packages will be upgraded:
  unattended-upgrades
1 upgraded, 0 newly installed, 0 to remove and 47 not upgraded.
Need to get 38.1 kB of archives.
After this operation, 0 B of additional disk space will be used.
Get:1 http://archive.ubuntu.com/ubuntu bionic-proposed/main amd64 
unattended-upgrades all 1.1ubuntu1.18.04.4 [38.1 kB]
Fetched 38.1 kB in 0s (107 kB/s)            
Preconfiguring packages ...
(Reading database ... 28484 files and directories currently installed.)
Preparing to unpack .../unattended-upgrades_1.1ubuntu1.18.04.4_all.deb ...
Unpacking unattended-upgrades (1.1ubuntu1.18.04.4) over (1.1ubuntu1) ...
Processing triggers for ureadahead (0.100.0-20) ...
Processing triggers for systemd (237-3ubuntu10) ...
Setting up unattended-upgrades (1.1ubuntu1.18.04.4) ...
Replacing config file /etc/apt/apt.conf.d/50unattended-upgrades with new version
Processing triggers for man-db (2.8.3-2) ...
root@bb-uu11ubuntu118041:~# 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
root@bb-uu11ubuntu118041:~# logout
rbalint@yogi:~$ sudo vi /etc/apt/apt.conf.d/51unattended-upgrades-metered 
rbalint@yogi:~$ cat /etc/apt/apt.conf.d/51unattended-upgrades-metered
Unattended-Upgrade::Skip-Updates-On-Metered-Connections "false";
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


** Tags removed: verification-needed verification-needed-bionic
** Tags added: verification-done verification-done-bionic

-- 
You received this bug notification because you are a member of Ubuntu
Bugs, which is subscribed to Ubuntu.
https://bugs.launchpad.net/bugs/1781183

Title:
  Skip updates on metered connections

To manage notifications about this bug go to:
https://bugs.launchpad.net/ubuntu/+source/unattended-upgrades/+bug/1781183/+subscriptions

-- 
ubuntu-bugs mailing list
[email protected]
https://lists.ubuntu.com/mailman/listinfo/ubuntu-bugs

Reply via email to