kle*_*und 9 upgrade dependencies 17.04
由于从 Ubuntu 16.04 升级到 17.04,我无法再安装gcc-7或g++-7从http://ppa.launchpad.net/ubuntu-toolchain-r/test/ubuntu存储库安装。事实上,我什至无法安装build-essential.
在Software & Updates > Other Software 下,存储库如下所示:
http://ppa.launchpad.net/ubuntu-toolchain-r/test/ubuntu zesty main
Run Code Online (Sandbox Code Playgroud)
尝试安装build-essential:
$ sudo apt install build-essential
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:
build-essential : Depends: gcc (>= 4:5.2) but it is not going to be installed
Depends: g++ (>= 4:5.2) but it is not going to be installed
E: Unable to correct problems, you have held broken packages.
Run Code Online (Sandbox Code Playgroud)
然而:
$ gcc --version
gcc (Ubuntu 5.4.1-8ubuntu1) 5.4.1 20170304
...
$ g++ --version
g++ (Ubuntu 5.4.1-8ubuntu1) 5.4.1 20170304
...
Run Code Online (Sandbox Code Playgroud)
那么如何build-essential重新安装呢?
所以我可以build-essential按照以下步骤再次安装:
$ sudo apt install build-essential
...
The following packages have unmet dependencies:
build-essential : Depends: gcc (>= 4:5.2) but it is not going to be installed
Depends: g++ (>= 4:5.2) but it is not going to be installed
Run Code Online (Sandbox Code Playgroud)
gcc需要 5.2 以上的版本,所以让我们尝试安装gcc.
$ sudo apt install gcc
...
The following packages have unmet dependencies:
gcc : Depends: cpp (>= 4:6.3.0-2ubuntu1) but it is not going to be installed
Depends: gcc-6 (>= 6.3.0-9~) but it is not going to be installed
Run Code Online (Sandbox Code Playgroud)
好的。还缺少其他东西。让我们尝试安装它。
$ sudo apt install cpp
...
The following packages have unmet dependencies:
cpp : Depends: cpp-6 (>= 6.3.0-9~) but it is not going to be installed
Run Code Online (Sandbox Code Playgroud)
依然没有。再试一次。
$ sudo apt install cpp-6
...
The following packages have unmet dependencies:
cpp-6 : Depends: gcc-6-base (= 6.3.0-12ubuntu2) but 6.3.0-18ubuntu2~16.04 is to be installed
Run Code Online (Sandbox Code Playgroud)
再来一次。
$ sudo apt install gcc-6-base
...
gcc-6-base is already the newest version (6.3.0-18ubuntu2~16.04).
Run Code Online (Sandbox Code Playgroud)
所以在这里我不知道到底出了什么问题。需要注意的是16.04,该版本号末尾有一个字符串。那看起来很奇怪。我删除了那个包。
$ sudo apt remove gcc-6-base
Run Code Online (Sandbox Code Playgroud)
现在我可以build-essential再次安装。这也将重新安装gcc-6-base.
$ sudo apt install build-essential
Run Code Online (Sandbox Code Playgroud)
遗留问题:
$ sudo apt upgrade
...
The following packages have been kept back:
cpp g++ gcc
Run Code Online (Sandbox Code Playgroud)
问题的根源与上面类似,gcc-7-base是有问题的,但我不能简单地将其删除,因为我得到了这个:
The following packages have unmet dependencies:
libgcc1 : Depends: gcc-7-base (= 7.1.0-5ubuntu2~16.04) but it is not going to be installed
va-driver-all : Depends: mesa-va-drivers but it is not going to be installed or
vdpau-va-driver but it is not going to be installed
E: Error, pkgProblemResolver::Resolve generated breaks, this may be caused by held packages.
Run Code Online (Sandbox Code Playgroud)
危险区域:
我设法通过以下步骤解决了这个问题:
$ sudo apt install aptitude
$ sudo dpkg --force-all -P gcc-7-base
$ sudo dpkg --force-all -P gcc-7-base:i386
$ sudo aptitude install gcc-7-base
Run Code Online (Sandbox Code Playgroud)
这是非常危险的,可能会破坏您的安装。执行dpkg --force-all -P将强制删除一个包,忽略对这个包的任何依赖。定期执行此操作apt upgrade可能会从您的安装中删除几乎所有相关软件。
我只能通过 usind 从那里恢复,aptitude这解决了我遇到的每个依赖问题。
| 归档时间: |
|
| 查看次数: |
16388 次 |
| 最近记录: |