San*_*eer 5 package-management 18.04
从 16.04 build-essential、g++、gcc 和 cpp 升级到 Ubuntu 18.04 之后 E: Unable to correct problems, you have held broken packages.
$ sudo apt-get 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:7.2) but it is not going to be installed
Depends: g++ (>= 4:7.2) but it is not going to be installed
E: Unable to correct problems, you have held broken packages.
$ sudo apt-get install gcc
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 : Depends: gcc-7 (>= 7.3.0-12~) but it is not going to be installed
E: Unable to correct problems, you have held broken packages.
Run Code Online (Sandbox Code Playgroud)
g++ 和 cpp 的相同类型的输出
如何解决这个问题?
我也遇到过同样的情况 - 在 Ubuntu 16.04 上,我有用于 gcc 和 clang 构建的工具链测试构建 PPA,包括gcc-7. 在升级到 18.04 期间,安装过程禁用了第 3 方存储库,其中包括此 PPA。
要解决此问题,请尝试(重新?)将工具链 PPA 添加到您的 apt 源列表中:
sudo add-apt-repository ppa:ubuntu-toolchain-r/test
sudo apt-get update
Run Code Online (Sandbox Code Playgroud)
然后,在安装时build-essential,它应该成功地gcc-7从工具链 PPA 中进行选择。
| 归档时间: |
|
| 查看次数: |
8734 次 |
| 最近记录: |