Linux 安装g&x2B+-7:未满足的依赖关系

Linux 安装g&x2B+-7:未满足的依赖关系,linux,ubuntu,Linux,Ubuntu,我想将gcc-7与g++-7一起安装。首先,我成功地安装了gcc7。我当然做了 sudo apt update 那么我无法安装g++7: anton@AntonLinux:/$ sudo apt install g++-7 Reading package lists... Done Building dependency tree Reading state information... Done Some packages could not be installed. Thi

我想将gcc-7与g++-7一起安装。首先,我成功地安装了gcc7。我当然做了

sudo apt update
那么我无法安装g++7:

anton@AntonLinux:/$ sudo apt install g++-7
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:
 libc6-dev : Breaks: libgcc-7-dev (< 7.5.0-6~) but 7.5.0-3ubuntu1~18.04 is to be installed
E: Unable to correct problems, you have held broken packages.

您是否运行了apt update?您不能使用更新版本的吗?当前的一个是。考虑你的问题来改进它。考虑重复你的命令tomorrow@BasileStarynkevitch当然,我已经完成了apt更新。我不能使用GCC10,我需要GCC7。你可以从它的源代码编译
anton@AntonLinux:/$ apt list --installed | grep libgcc

WARNING: apt does not have a stable CLI interface. Use with caution in scripts.

libgcc-10-dev/unstable,now 10.2.0-13 amd64 [installed,automatic]
libgcc-4.8-dev/bionic,now 4.8.5-4ubuntu8 amd64 [installed,automatic]
libgcc-6-dev/bionic-updates,now 6.5.0-2ubuntu1~18.04 amd64 [installed,automatic]
libgcc-s1/unstable,now 10.2.0-13 amd64 [installed,automatic]
libgcc-s1/unstable,now 10.2.0-13 i386 [installed,automatic]
libgcc1/bionic-updates,bionic-security,now 1:8.4.0-1ubuntu1~18.04 amd64 [installed,upgradable to: 1:10.1.0-1]
libgcc1/bionic-updates,bionic-security,now 1:8.4.0-1ubuntu1~18.04 i386 [installed,upgradable to: 1:10.1.0-1]


anton@AntonLinux:/$ apt list --installed | grep libc6

WARNING: apt does not have a stable CLI interface. Use with caution in scripts.

libc6-dbg/unstable,now 2.31-4 amd64 [installed,automatic]
libc6/unstable,now 2.31-4 amd64 [installed,automatic]
libc6/unstable,now 2.31-4 i386 [installed,automatic]


anton@AntonLinux:/$ apt list --installed | grep gcc

WARNING: apt does not have a stable CLI interface. Use with caution in scripts.

gcc-10-base/unstable,now 10.2.0-13 amd64 [installed,automatic]
gcc-10-base/unstable,now 10.2.0-13 i386 [installed,automatic]
gcc-10/unstable,now 10.2.0-13 amd64 [installed,automatic]
gcc-4.8-base/bionic,now 4.8.5-4ubuntu8 amd64 [installed,automatic]
gcc-4.8/bionic,now 4.8.5-4ubuntu8 amd64 [installed]
gcc-6-base/bionic-updates,now 6.5.0-2ubuntu1~18.04 amd64 [installed,automatic]
gcc-6/bionic-updates,now 6.5.0-2ubuntu1~18.04 amd64 [installed,automatic]
gcc-7-base/bionic-updates,bionic-security,now 7.5.0-3ubuntu1~18.04 amd64 [installed,automatic]
gcc-8-base/bionic-updates,bionic-security,now 8.4.0-1ubuntu1~18.04 amd64 [installed,upgradable to: 8.4.0-4]
gcc-8-base/bionic-updates,bionic-security,now 8.4.0-1ubuntu1~18.04 i386 [installed,upgradable to: 8.4.0-4]
gcc/unstable,now 4:10.2.0-1 amd64 [installed,automatic]
libgcc-10-dev/unstable,now 10.2.0-13 amd64 [installed,automatic]
libgcc-4.8-dev/bionic,now 4.8.5-4ubuntu8 amd64 [installed,automatic]
libgcc-6-dev/bionic-updates,now 6.5.0-2ubuntu1~18.04 amd64 [installed,automatic]
libgcc-s1/unstable,now 10.2.0-13 amd64 [installed,automatic]
libgcc-s1/unstable,now 10.2.0-13 i386 [installed,automatic]
libgcc1/bionic-updates,bionic-security,now 1:8.4.0-1ubuntu1~18.04 amd64 [installed,upgradable to: 1:10.1.0-1]
libgcc1/bionic-updates,bionic-security,now 1:8.4.0-1ubuntu1~18.04 i386 [installed,upgradable to: 1:10.1.0-1]