我正在尝试从云存档中在我的 Ubuntu 12.04 上安装 Keystone,并且它会继续安装来自精确更新的软件包。
以下是apt-cache madison keystone
揭示的内容。
root@cloud:/etc/puppet# apt-cache madison keystone
keystone | 1:2013.1.2-0ubuntu2~cloud0 | http://ubuntu-cloud.archive.canonical.com/ubuntu/ precise-updates/grizzly/main amd64 Packages
keystone | 2012.1.3+stable-20130423-f48dd0fc-0ubuntu1.1 | http://us.archive.ubuntu.com/ubuntu/ precise-updates/main amd64 Packages
keystone | 2012.1.3+stable-20130423-f48dd0fc-0ubuntu1.1 | http://security.ubuntu.com/ubuntu/ precise-security/main amd64 Packages
keystone | 2012.1-0ubuntu1 | http://us.archive.ubuntu.com/ubuntu/ precise/main amd64 Packages
keystone | 2012.1-0ubuntu1 | http://us.archive.ubuntu.com/ubuntu/ precise/main Sources
keystone | 2012.1.3+stable-20130423-f48dd0fc-0ubuntu1.1 | http://us.archive.ubuntu.com/ubuntu/ precise-updates/main Sources
keystone | 2012.1.3+stable-20130423-f48dd0fc-0ubuntu1.1 | http://security.ubuntu.com/ubuntu/ precise-security/main Sources
keystone | 1:2013.1.2-0ubuntu2~cloud0 | http://ubuntu-cloud.archive.canonical.com/ubuntu/ precise-updates/grizzly/main Sources
但是当我apt-get install keystone
得到这个版本时:2012.1.3+stable-20130423-f48dd0fc-0ubuntu1.1
而不是预期的1:2013.1.2-0ubuntu2~cloud0
。我怀疑我一定做错了什么,但我不知道是什么。
我正在尝试构建一个 Puppet 清单来实现这一自动化,并且需要弄清楚如何确保在启用云存档时 Apt 安装预期版本。
答案1
我通过这个问题找到了解决方案:为我的本地存储库分配最高优先级
基本上,标准精确更新存储库的优先级为 990,这远远超出了云存档的默认优先级 10。因此,快速调整以将云存档的优先级固定为 1000,现在就可以安装正确的软件包。
如果有人再次遇到此问题,请首先检查输出apt-cache policy keystone
以查看您的版本优先级:
root@cloud:/etc/puppet# apt-cache policy keystone
keystone:
Installed: 2012.1.3+stable-20130423-f48dd0fc-0ubuntu1.1
Candidate: 2012.1.3+stable-20130423-f48dd0fc-0ubuntu1.1
Version table:
1:2013.1.2-0ubuntu2~cloud0 0
10 http://ubuntu-cloud.archive.canonical.com/ubuntu/ precise-updates/grizzly/main amd64 Packages
*** 2012.1.3+stable-20130423-f48dd0fc-0ubuntu1.1 0
990 http://us.archive.ubuntu.com/ubuntu/ precise-updates/main amd64 Packages
990 http://security.ubuntu.com/ubuntu/ precise-security/main amd64 Packages
100 /var/lib/dpkg/status
2012.1-0ubuntu1 0
990 http://us.archive.ubuntu.com/ubuntu/ precise/main amd64 Packages
调整我的引脚后,输出现在如下所示:
root@cloud:/etc/puppet# apt-cache policy keystone
keystone:
Installed: 1:2013.1.2-0ubuntu2~cloud0
Candidate: 1:2013.1.2-0ubuntu2~cloud0
Version table:
*** 1:2013.1.2-0ubuntu2~cloud0 0
1000 http://ubuntu-cloud.archive.canonical.com/ubuntu/ precise-updates/grizzly/main amd64 Packages
100 /var/lib/dpkg/status
2012.1.3+stable-20130423-f48dd0fc-0ubuntu1.1 0
990 http://us.archive.ubuntu.com/ubuntu/ precise-updates/main amd64 Packages
990 http://security.ubuntu.com/ubuntu/ precise-security/main amd64 Packages
2012.1-0ubuntu1 0
990 http://us.archive.ubuntu.com/ubuntu/ precise/main amd64 Packages