Working on Ubuntu 14.04.5 LTS. zsh
is a package, for which an upgrade is available:
# apt-cache policy zsh
zsh:
Installed: 5.0.2-3ubuntu6
Candidate: 5.0.2-3ubuntu6
Version table:
5.0.5-4ubuntu1~ubuntu14.04.1 0
100 http://nova.clouds.archive.ubuntu.com/ubuntu/ trusty-backports/main amd64 Packages
*** 5.0.2-3ubuntu6 0
500 http://nova.clouds.archive.ubuntu.com/ubuntu/ trusty/main amd64 Packages
100 /var/lib/dpkg/status
However, neither apt-get install zsh
nor unattended-upgrades
would upgrade it:
apt-get
# apt-get install --dry-run zsh
Reading package lists... Done
Building dependency tree
Reading state information... Done
zsh is already the newest version.
0 upgraded, 0 newly installed, 0 to remove and 0 not upgraded.
unattended-upgrade
# unattended-upgrade --debug
Initial blacklisted packages:
Starting unattended upgrades script
Allowed origins are: ['o=LP-PPA-brightbox-ruby-ng,a=trusty', 'o=Percona Development Team,a=', 'o=Ubuntu,a=trusty-security', 'o=Ubuntu,a=trusty-updates', 'o=Ubuntu,a=trusty', 'o=Ubuntu,a=trusty-backports', 'o=LP-PPA-ondrej-php,a=trusty', 'o=RabbitMQ,a=testing', 'o=LP-PPA-vbernat-haproxy-1.5,a=trusty', 'o=Node Source,a=', 'o=,a=now', 'o=Ubuntu,a=trusty-security', 'o=Ubuntu,a=trusty', 'o=UbuntuESM,a=trusty', 'o=Ubuntu,a=trusty-updates', 'o=Ubuntu,a=trusty-proposed', 'o=Ubuntu,a=trusty-backports', 'o=LP-PPA-ondrej-php,a=trusty', 'o=LP-PPA-brightbox-ruby-ng,a=trusty', 'o=Node Source,a=trusty']
pkgs that look like they should be upgraded:
Fetched 0 B in 0s (0 B/s)
fetch.run() result: 0
blacklist: []
No packages found that can be upgraded unattended and no pending auto-removals
Even if I explicitly request the new version, no upgrade will take place:
# apt-get install zsh=5.0.5-4ubuntu1~ubuntu14.04.1
Reading package lists... Done
Building dependency tree
Reading state information... Done
The following extra packages will be installed:
zsh
Suggested packages:
zsh-doc
0 upgraded, 0 newly installed, 0 to remove and 0 not upgraded.
Why would apt-get
lie to me, that I already have the latest version? Why would unattended-upgrades
similarly skip it, even though I list all possible origins, including trusty-backports
, in its /etc/apt/apt.conf.d/50unattended-upgrades
as "allowed"?
UPDATE: yes, it would make sense, that "backports" be disabled by default. However, we have them listed as valid origins in /etc/apt/sources.list
:
## Uncomment the following two lines to add software from the 'backports'
## repository.
## N.B. software from this repository may not have been tested as
## extensively as that contained in the main release, although it includes
## newer versions of some applications which may provide useful features.
## Also, please note that software in backports WILL NOT receive any review
## or updates from the Ubuntu security team.
deb http://nova.clouds.archive.ubuntu.com/ubuntu/ trusty-backports main restricted universe multiverse
deb-src http://nova.clouds.archive.ubuntu.com/ubuntu/ trusty-backports main restricted universe multiverse
Even if I remove the restricted
part from the above lines, it still would not upgrade zsh...
UPDATE: After studying the link @olivierb2 offered in his comment below, I created /etc/apt/preferences.d/equalize
to force equal priority to all origins:
Package: *
Pin: release a=trusty-security
Pin-Priority: 509
Package: *
Pin: release a=trusty
Pin-Priority: 509
Package: *
Pin: release a=testing
Pin-Priority: 509
Package: *
Pin: release a=trusty-updates
Pin-Priority: 509
Package: *
Pin: release a=trusty-backports
Pin-Priority: 509
Package: *
Pin: release a=now
Pin-Priority: 509
And now things work as I expect them to:
# apt-cache policy zsh
zsh:
Installed: 5.0.2-3ubuntu6
Candidate: 5.0.5-4ubuntu1~ubuntu14.04.1
Version table:
5.0.5-4ubuntu1~ubuntu14.04.1 0
509 http://nova.clouds.archive.ubuntu.com/ubuntu/ trusty-backports/main amd64 Packages
*** 5.0.2-3ubuntu6 0
509 http://nova.clouds.archive.ubuntu.com/ubuntu/ trusty/main amd64 Packages
509 /var/lib/dpkg/status
I still do not understand, just what controls the priorities in the absence of explicit "preferences" setting. But now I have the solution.