我一直在尝试安装 gcc-13 和 g++-13,以便能够访问 C++20 中的全部功能。我遇到了一个依赖问题,该问题作为子包没有意义导致问题的安装版本高于所需版本。
通过
升级我的软件包后sudo apt update
sudo apt upgrade
sudo apt autoremove --purge
还有16个包没有升级。 我还通过
添加了 ubuntu 工具链的测试仓库sudo add-apt-repository ppa:ubuntu-toolchain-r/test
跑步时
sudo apt install gcc-13 g++-13
我收到以下错误
The following packages have unmet dependencies:
libgcc-13-dev : Depends: libgcc-s1 (>= 13.1.0-8ubuntu1~22.04) but 12.1.0-2ubuntu1~22.04 is to be installed
E: Unable to correct problems, you have held broken packages.
为了尝试解决这个问题,我正在跑步
sudo apt install libgcc-s1
这会导致
The following packages have unmet dependencies:
libcrypt1:i386 : Depends: libc6:i386 (>= 2.25) but it is not going to be installed
E: Error, pkgProblemResolver::Resolve generated breaks, this may be caused by held packages.
我终于跑步了
sudo apt install libc6:i386
但它指出
libc6:i386 is already the newest version (2.35-0ubuntu3.6)
如果这个版本是2.35-0,那为什么会出现依赖问题呢?我该如何解决这个问题?
安装g++ 只需安装
build-essential
。它与 g++ 和 gcc 一起提供
运行此命令
sudo apt-get update
sudo apt-get install build-essential
``