我最近从 12.04 升级到了 14.04。升级后,事情开始变得糟糕。
我正进入(状态crt1.o:没有这样的文件:没有这样的文件或目录。因此,我尝试安装 gcc-multilib,但是,这也遇到了错误。
$ sudo apt-get install gcc-multilib
Reading package lists... Done
Building dependency tree
Reading state information... Done
Some packages could not be installed. This may mean that you have
requested an impossible situation or if you are using the unstable
distribution that some required packages have not yet been created
or been moved out of Incoming.
The following information may help to resolve the situation:
The following packages have unmet dependencies:
gcc-multilib : Depends: gcc-4.8-multilib (>= 4.8.2-5~) but it is not going to be installed
E: Unable to correct problems, you have held broken packages.
我试过
$ sudo apt-get -o Debug::pkgProblemResolver=yes dist-upgrade
Reading package lists... Done
Building dependency tree
Reading state information... Done
Calculating upgrade... Starting pkgProblemResolver with broken count: 0
Starting 2 pkgProblemResolver with broken count: 0
Done
Done
Starting pkgProblemResolver with broken count: 0
Starting 2 pkgProblemResolver with broken count: 0
Done
0 upgraded, 0 newly installed, 0 to remove and 0 not upgraded.
我尝试发布以下命令的输出但无法做到。
cat /etc/apt/sources.list
cat /etc/apt/sources.list.d/*
我该如何解决这个问题?
$ sudo apt-get install gcc-4.8-multilib
Reading package lists... Done
Building dependency tree
Reading state information... Done
Some packages could not be installed. This may mean that you have
requested an impossible situation or if you are using the unstable
distribution that some required packages have not yet been created
or been moved out of Incoming.
The following information may help to resolve the situation:
The following packages have unmet dependencies:
gcc-4.8-multilib : Depends: lib32gcc-4.8-dev (= 4.8.2-19ubuntu1) but it is not going to be installed
Depends: libx32gcc-4.8-dev (= 4.8.2-19ubuntu1) but it is not going to be installed
E: Unable to correct problems, you have held broken packages.
$ sudo apt-get install lib32gcc-4.8-dev
Reading package lists... Done
Building dependency tree
Reading state information... Done
Some packages could not be installed. This may mean that you have
requested an impossible situation or if you are using the unstable
distribution that some required packages have not yet been created
or been moved out of Incoming.
The following information may help to resolve the situation:
The following packages have unmet dependencies:
lib32gcc-4.8-dev : Depends: lib32gcc1 (>= 1:4.8.2-19ubuntu1) but it is not going to be installed
Depends: libx32gcc1 (>= 1:4.8.2-19ubuntu1) but it is not going to be installed
Depends: lib32asan0 (>= 4.8.2-19ubuntu1) but it is not going to be installed
Depends: libx32asan0 (>= 4.8.2-19ubuntu1) but it is not going to be installed
E: Unable to correct problems, you have held broken packages.
$ sudo apt-get install lib32gcc1 libx32gcc1 lib32asan0 libx32asan0
Reading package lists... Done
Building dependency tree
Reading state information... Done
Some packages could not be installed. This may mean that you have
requested an impossible situation or if you are using the unstable
distribution that some required packages have not yet been created
or been moved out of Incoming.
The following information may help to resolve the situation:
The following packages have unmet dependencies:
lib32gcc1 : Depends: gcc-4.9-base (= 4.9-20140406-0ubuntu1) but 4.9.1-0ubuntu1 is to be installed
libx32gcc1 : Depends: gcc-4.9-base (= 4.9-20140406-0ubuntu1) but 4.9.1-0ubuntu1 is to be installed
E: Unable to correct problems, you have held broken packages.
$ apt-cache policy lib32gcc-4.8-dev lib32gcc1 gcc-4.9-base
lib32gcc-4.8-dev:
Installed: (none)
Candidate: 4.8.2-19ubuntu1
Version table:
4.8.2-19ubuntu1 0
500 http://archive.ubuntu.com/ubuntu/ trusty/main amd64 Packages
lib32gcc1:
Installed: (none)
Candidate: 1:4.9-20140406-0ubuntu1
Version table:
1:4.9.1-0ubuntu1 0
100 /var/lib/dpkg/status
1:4.9-20140406-0ubuntu1 0
500 http://archive.ubuntu.com/ubuntu/ trusty/main amd64 Packages
gcc-4.9-base:
Installed: 4.9.1-0ubuntu1
Candidate: 4.9.1-0ubuntu1
Version table:
*** 4.9.1-0ubuntu1 0
100 /var/lib/dpkg/status
4.9-20140406-0ubuntu1 0
500 http://archive.ubuntu.com/ubuntu/ trusty/main amd64 Packages
链接到 sudo apt-get update 的输出:http://paste.ubuntu.com/9810181/
答案1
我并不经常使用aptitude
,但如果出现 gcc 版本不同且依赖关系未得到满足的问题,apt-get
有时无法纠正问题,并提示“您持有损坏的软件包”
那一天,你应该安装aptitude
,然后尝试安装您想要的软件包。它清楚地显示了所有依赖项,并且不仅仅提出了一个建议。
第一个建议通常与 apt-get 所做的相同,但如果您单击“否”,aptitude 将显示另一个建议,也许更适合您的需求。
试一试!
答案有点晚了,但我经常寻找类似的问题并对不同的解决方案感到高兴。
答案2
观察到的行为似乎是由以下描述的合法错误引起的:
https://bugs.launchpad.net/ubuntu/+source/eglibc/+bug/1365375
上述报告包含我的短期解决方法,可apt-get
再次使用。
我相信,从本质上来说,sudo apt-get -f install 失败是该问题的重复。