还有一个类似的问题,获取无法安装apt-缓存策略中列出的特定版本.。但这不是我的案子。
我想安装python的特定旧版本(1:2013.2.3-0ubuntu1~cloud0),但失败了,这是我所做的:
root@ip-10-20-17:~# apt-cache policy python-nova
python-nova:
Installed: (none)
Candidate: 1:2014.1.3-0ubuntu1~cloud0.1
Version table:
1:2014.1.3-0ubuntu1~cloud0.1 0
900 http://apt.myserver.com/game-cloud-ops/ precise/main amd64 Packages
1:2014.1.2-0ubuntu1.1~cloud0-5 0
900 http://apt.myserver.com/game-cloud-ops/ precise/main amd64 Packages
1:2014.1.2-0ubuntu1.1~cloud0-4 0
900 http://apt.myserver.com/game-cloud-ops/ precise/main amd64 Packages
1:2014.1.2-0ubuntu1.1~cloud0-2 0
900 http://apt.myserver.com/game-cloud-ops/ precise/main amd64 Packages
1:2014.1.2-0ubuntu1.1~cloud0~-1 0
900 http://apt.myserver.com/game-cloud-ops/ precise/main amd64 Packages
1:2014.1.2-0ubuntu1.1~cloud063 0
900 http://apt.myserver.com/game-cloud-ops/ precise/main amd64 Packages
1:2014.1.2-0ubuntu1.1~cloud062 0
900 http://apt.myserver.com/game-cloud-ops/ precise/main amd64 Packages
1:2014.1.2-0ubuntu1.1~cloud061 0
900 http://apt.myserver.com/game-cloud-ops/ precise/main amd64 Packages
1:2014.1.2-0ubuntu1.1~cloud0~3 0
900 http://apt.myserver.com/game-cloud-ops/ precise/main amd64 Packages
1:2013.2.3-0ubuntu1~cloud0 0
-10 http://apt.myserver.com/ubuntu-cloud-archive/ precise-updates/havana/main amd64 Packages
2012.1.3+stable-20130423-e52e6912-0ubuntu1.4 0
900 http://mirror.myserver.com/ubuntu/ precise-security/main amd64 Packages
900 http://mirror.myserver.com/ubuntu/ precise-updates/main amd64 Packages
2012.1-0ubuntu2 0
900 http://mirror..myserver.com/ubuntu/ precise/main amd64 Packages
root@ip-10-20-17:~# apt-get -o Debug::pkgProblemResolver=yes install python-nova=1:2013.2.3-0ubuntu1~cloud0
Reading package lists... Done
Building dependency tree... 0%
Building dependency tree
Reading state information... Done
Starting
Starting 2
Investigating (0) python-nova [ amd64 ] < none -> 1:2014.1.3-0ubuntu1~cloud0.1 > ( python )
Broken python-nova:amd64 Depends on python-anyjson [ amd64 ] < none -> 0.3.3-1~cloud0 > ( python ) (>= 0.3.3)
.....
.....
.....
The following packages have unmet dependencies:
python-nova : Depends: python-anyjson (>= 0.3.3) but 0.3.1-1build1 is to be installed
Depends: python-boto (>= 2.4.0) but 2.2.2-0ubuntu3 is to be installed
Depends: python-cinderclient (>= 1:1.0.5) but it is not installable
Depends: python-eventlet (>= 0.13.0) but 0.9.16-1ubuntu4.2 is to be installed
Depends: python-greenlet (>= 0.3.2) but 0.3.1-1ubuntu5.1 is to be installed
Depends: python-glanceclient (>= 1:0.9.0) but it is not installable
Depends: python-keystoneclient (>= 1:0.3.2) but 2012.1-0ubuntu1 is to be installed
Depends: python-neutronclient (>= 1:2.3.0) but it is not installable
Depends: python-jsonschema (>= 1.3.0) but it is not installable
Depends: python-kombu (>= 2.5.12) but 1.4.3-1 is to be installed
Depends: python-netaddr (>= 0.7.6) but 0.7.5-4build2 is to be installed
Depends: python-oslo.config (>= 1:1.2.0) but it is not installable
Depends: python-paramiko (>= 1.8.0) but 1.7.7.1-2ubuntu1 is to be installed
Depends: python-sqlalchemy-ext (>= 0.7.8-1~) but 0.7.4-1ubuntu0.1 is to be installed or
python-sqlalchemy (< 0.6.3-2) but 0.7.4-1ubuntu0.1 is to be installed
Depends: python-stevedore (>= 0.10) but it is not installable
Depends: python-webob (>= 1.2.3) but 1.1.1-1ubuntu0 is to be installed
Depends: python-pbr but it is not installable
Depends: python-sqlalchemy (>= 0.8~) but 0.7.4-1ubuntu0.1 is to be installed
E: Unable to correct problems, you have held broken packages.我很抱歉。我错过了一些重要的信息。依赖程序包是存在的,但是apt缓存策略不喜欢它们,例如:
root@ip-10-20-17:~# apt-cache policy python-anyjson
python-anyjson:
Installed: (none)
Candidate: 0.3.1-1build1
Version table:
0.3.3-1~cloud0 0
-10 http://apt.myserver.com/ubuntu-cloud-archive/ precise-updates/havana/main amd64 Packages
0.3.1-1build1 0
900 http://mirror.myserver.com/ubuntu/ precise/main amd64 PackagesPython-anyjson0.3.3-1~Cloud0已经存在,但是apt缓存策略并不喜欢它。优先-10意味着什么?
发布于 2016-12-09 11:26:31
包可以对其他包具有依赖关系。在您的例子中,python-nova依赖于python-anyjson、python-boto、python-cinderclient等等。因此,要安装python-nova,还需要安装这些软件包。
此依赖关系也是特定于版本的。要安装特定版本的python-nova,还需要安装特定版本的依赖包。例如,对于版本1:2013.2.3-0ubuntu1~cloud0中的python-nova,您需要0.3.3或更高版本的python-anyjson,但只有0.3.1-1build 1版本可用:
python-nova : Depends: python-anyjson (>= 0.3.3) but 0.3.1-1build1 is to be installed因此,您不仅需要检查python-nova本身在您需要的版本中是否可用,而且还需要检查python-nova所依赖的所有包是否都在相应的版本中可用。python-nova所依赖的包也可以有其他依赖项。
正因为如此,我建议重新检查您是否真的需要那个特定的版本。满足包A的所有依赖关系,然后满足A依赖项的所有依赖关系,就会成为一个麻烦,然后.您还可以考虑使用另一个发行版或较旧的Ubuntu版本,其中您需要的python-nova版本是默认版本,并且不需要自己处理所有依赖项。当然,这在很大程度上取决于你打算做什么的细节。
发布于 2016-12-13 07:11:11
最后,我从如何禁止安装特定的软件包?的暗示中找出了它。
To block the installation of a given package we may put the following lines in /etc/apt/preferences
Package:
Pin: origin ""
Pin-Priority: -1在我的服务器上有这样一个配置,在rm之后,它可以工作。
root@ip-10-20-17:~# cat /etc/apt/preferences.d/00fix_codename
Explanation: Uninstall or do not install any other DISTRIB_CODENAME
Explanation: package versions other than those in the precise distro
Package: *
Pin: release n=precise
Pin-Priority: 900
Package: *
Pin: release n=*
Pin-Priority: -10感谢所有关心这个问题的人,尤其是亨宁·科克贝克。
https://askubuntu.com/questions/858736
复制相似问题