在 Ubuntu 14.04.5 LTS 上运行的zsh
是一个软件包,可以进行升级:
# 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
但是,也apt-get install zsh
不会unattended-upgrades
升级它:
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 --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
即使我明确请求新版本,也不会进行升级:
# 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.
为什么要apt-get
骗我说我已经有了最新版本?为什么unattended-upgrades
同样要跳过它,即使我列出了所有可能的来源,包括trusty-backports
,并将其/etc/apt/apt.conf.d/50unattended-upgrades
列为“允许”?
更新:是的,默认情况下禁用“反向移植”是有道理的。但是,我们已将它们列为有效来源/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
即使我删除restricted
上面几行中的部分,它仍然不会升级 zsh......
更新: 经过研究关联@olivierb2 在下面的评论中提出,我创建了/etc/apt/preferences.d/equalize
强制所有来源具有同等优先级的功能:
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
现在一切都按照我期望的方式运行了:
# 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
我仍然不明白,在没有明确“偏好”设置的情况下,究竟是什么控制着优先级。但现在我有了解决方案。
答案1
默认情况下,Backport 是禁用的,你必须使用以下命令从 Backport 升级你的软件包
apt-get install zsh -t trusty-backports
编辑:我想念源页面在哪里可以找到信息