我是一名计算机科学专业的学生,也是 Linux Mint 18.2 的新手。我正在尝试在 Clion 中运行一个简单的项目,但显然我的 gcc++ 编译器有问题。
我尝试在终端中运行此命令:
sudo apt-get install gcc++
并得到以下结果:
Reading package lists... Done
Building dependency tree
Reading state information... Done
Note, selecting 'gcc-4.9-hppa-linux-gnu' for regex 'gcc+'
Note, selecting 'libsfgcc1-dbg-armhf-cross' for regex 'gcc+'
长长的注释列表,选择......,最后是:
The following packages have unmet dependencies:
gcc-4.7-plugin-dev : Depends: libgmpv4-dev (>= 2:5.0.1~) but it is not going to be installed
gcc-4.8-aarch64-linux-gnu : Conflicts: gcc-multilib but 4:5.3.1-1ubuntu1 is to be installed
gcc-4.8-arm-linux-gnueabihf : Conflicts: gcc-multilib but 4:5.3.1-1ubuntu1 is to be installed
gcc-4.8-multilib : Depends: libc6-dev-x32 (>= 2.11) but it is not going to be installed
gcc-4.8-powerpc-linux-gnu : Conflicts: gcc-multilib but 4:5.3.1-1ubuntu1 is to be installed
gcc-4.8-powerpc64le-linux-gnu : Conflicts: gcc-multilib but 4:5.3.1-1ubuntu1 is to be installed
gcc-4.9-aarch64-linux-gnu : Conflicts: gcc-multilib but 4:5.3.1-1ubuntu1 is to be installed
gcc-4.9-arm-linux-gnueabi : Conflicts: gcc-multilib but 4:5.3.1-1ubuntu1 is to be installed
gcc-4.9-arm-linux-gnueabihf : Conflicts: gcc-multilib but 4:5.3.1-1ubuntu1 is to be installed
gcc-4.9-multilib : Depends: libc6-dev-x32 (>= 2.11) but it is not going to be installed
gcc-4.9-powerpc-linux-gnu : Conflicts: gcc-multilib but 4:5.3.1-1ubuntu1 is to be installed
gcc-4.9-powerpc64le-linux-gnu : Conflicts: gcc-multilib but 4:5.3.1-1ubuntu1 is to be installed
gcc-4.9-s390x-linux-gnu : Conflicts: gcc-multilib but 4:5.3.1-1ubuntu1 is to be installed
gcc-5-aarch64-linux-gnu : Conflicts: gcc-multilib but 4:5.3.1-1ubuntu1 is to be installed
gcc-5-alpha-linux-gnu : Conflicts: gcc-multilib but 4:5.3.1-1ubuntu1 is to be installed
gcc-5-arm-linux-gnueabi : Conflicts: gcc-multilib but 4:5.3.1-1ubuntu1 is to be installed
gcc-5-arm-linux-gnueabihf : Conflicts: gcc-multilib but 4:5.3.1-1ubuntu1 is to be installed
gcc-5-hppa-linux-gnu : Conflicts: gcc-multilib but 4:5.3.1-1ubuntu1 is to be installed
gcc-5-m68k-linux-gnu : Conflicts: gcc-multilib but 4:5.3.1-1ubuntu1 is to be installed
gcc-5-mips-linux-gnu : Conflicts: gcc-multilib but 4:5.3.1-1ubuntu1 is to be installed
gcc-5-mips64-linux-gnuabi64 : Conflicts: gcc-multilib but 4:5.3.1-1ubuntu1 is to be installed
gcc-5-mips64el-linux-gnuabi64 : Conflicts: gcc-multilib but 4:5.3.1-1ubuntu1 is to be installed
gcc-5-mipsel-linux-gnu : Conflicts: gcc-multilib but 4:5.3.1-1ubuntu1 is to be installed
gcc-5-multilib : Depends: libc6-dev-x32 (>= 2.11) but it is not going to be installed
gcc-5-powerpc-linux-gnu : Conflicts: gcc-multilib but 4:5.3.1-1ubuntu1 is to be installed
gcc-5-powerpc-linux-gnuspe : Conflicts: gcc-multilib but 4:5.3.1-1ubuntu1 is to be installed
gcc-5-powerpc64-linux-gnu : Conflicts: gcc-multilib but 4:5.3.1-1ubuntu1 is to be installed
gcc-5-powerpc64le-linux-gnu : Conflicts: gcc-multilib but 4:5.3.1-1ubuntu1 is to be installed
gcc-5-s390x-linux-gnu : Conflicts: gcc-multilib but 4:5.3.1-1ubuntu1 is to be installed
gcc-5-sh4-linux-gnu : Conflicts: gcc-multilib but 4:5.3.1-1ubuntu1 is to be installed
gcc-5-sparc64-linux-gnu : Conflicts: gcc-multilib but 4:5.3.1-1ubuntu1 is to be installed
gcc-multilib : Conflicts: gcc-4.9-aarch64-linux-gnu but 4.9.3-13ubuntu2cross1 is to be installed
Conflicts: gcc-4.9-arm-linux-gnueabi but 4.9.3-13ubuntu2cross1 is to be installed
Conflicts: gcc-4.9-arm-linux-gnueabihf but 4.9.3-13ubuntu2cross1 is to be installed
Conflicts: gcc-4.9-powerpc-linux-gnu but 4.9.3-13ubuntu2cross1 is to be installed
Conflicts: gcc-4.9-powerpc64le-linux-gnu but 4.9.3-13ubuntu2cross1 is to be installed
Conflicts: gcc-4.9-s390x-linux-gnu but 4.9.3-13ubuntu2cross1 is to be installed
Conflicts: gcc-5-aarch64-linux-gnu
Conflicts: gcc-5-alpha-linux-gnu
Conflicts: gcc-5-arm-linux-gnueabi
Conflicts: gcc-5-arm-linux-gnueabihf
Conflicts: gcc-5-hppa-linux-gnu
Conflicts: gcc-5-m68k-linux-gnu
Conflicts: gcc-5-mips-linux-gnu
Conflicts: gcc-5-mips64-linux-gnuabi64
Conflicts: gcc-5-mips64el-linux-gnuabi64
Conflicts: gcc-5-mipsel-linux-gnu
Conflicts: gcc-5-powerpc-linux-gnu
Conflicts: gcc-5-powerpc-linux-gnuspe
Conflicts: gcc-5-powerpc64-linux-gnu
Conflicts: gcc-5-powerpc64le-linux-gnu
Conflicts: gcc-5-s390x-linux-gnu
Conflicts: gcc-5-sh4-linux-gnu
Conflicts: gcc-5-sparc64-linux-gnu
Conflicts: gcc-5-aarch64-linux-gnu:i386
Conflicts: gcc-5-arm-linux-gnueabihf:i386
Conflicts: gcc-5-powerpc-linux-gnu:i386
Conflicts: gcc-5-powerpc64le-linux-gnu:i386
Conflicts: gcc-5-alpha-linux-gnu:i386
Conflicts: gcc-5-arm-linux-gnueabi:i386
Conflicts: gcc-5-hppa-linux-gnu:i386
Conflicts: gcc-5-m68k-linux-gnu:i386
Conflicts: gcc-5-mips-linux-gnu:i386
Conflicts: gcc-5-mips64-linux-gnuabi64:i386
Conflicts: gcc-5-mips64el-linux-gnuabi64:i386
Conflicts: gcc-5-mipsel-linux-gnu:i386
Conflicts: gcc-5-powerpc-linux-gnuspe:i386
Conflicts: gcc-5-powerpc64-linux-gnu:i386
Conflicts: gcc-5-s390x-linux-gnu:i386
Conflicts: gcc-5-sh4-linux-gnu:i386
Conflicts: gcc-5-sparc64-linux-gnu:i386
gcc-snapshot : Depends: libc6-dev-x32 (>= 2.11) but it is not going to be installed
Depends: libc6-x32 (>= 2.23) but it is not going to be installed
gccgo-4.7-multilib : Depends: libx32go0 (>= 4.7.4-3ubuntu12) but it is not going to be installed
gccgo-4.8-multilib : Depends: libx32go4 (>= 4.8.5-4ubuntu2) but it is not going to be installed
gccgo-4.9-multilib : Depends: libx32go5 (>= 4.9.3-13ubuntu2) but it is not going to be installed
gccgo-5-multilib : Depends: libx32go7 (>= 5.4.0-6ubuntu1~16.04.5) but it is not going to be installed
gccgo-6-multilib : Depends: libx32go9 (>= 6.0.1-0ubuntu1) but it is not going to be installed
lib32gcc-4.7-dev : Depends: libx32gomp1 (>= 4.7.4-3ubuntu12) but it is not going to be installed
Depends: libx32itm1 (>= 4.7.4-3ubuntu12) but it is not going to be installed
Depends: libx32quadmath0 (>= 4.7.4-3ubuntu12) but it is not going to be installed
lib32gcc-4.8-dev : Depends: libx32gomp1 (>= 4.8.5-4ubuntu2) but it is not going to be installed
Depends: libx32itm1 (>= 4.8.5-4ubuntu2) but it is not going to be installed
Depends: libx32atomic1 (>= 4.8.5-4ubuntu2) but it is not going to be installed
Depends: libx32asan0 (>= 4.8.5-4ubuntu2) but it is not going to be installed
Depends: libx32quadmath0 (>= 4.8.5-4ubuntu2) but it is not going to be installed
lib32gcc-4.9-dev : Depends: libx32gomp1 (>= 4.9.3-13ubuntu2) but it is not going to be installed
Depends: libx32itm1 (>= 4.9.3-13ubuntu2) but it is not going to be installed
Depends: libx32atomic1 (>= 4.9.3-13ubuntu2) but it is not going to be installed
Depends: libx32asan1 (>= 4.9.3-13ubuntu2) but it is not going to be installed
Depends: libx32ubsan0 (>= 4.9.3-13ubuntu2) but it is not going to be installed
Depends: libx32cilkrts5 (>= 4.9.3-13ubuntu2) but it is not going to be installed
Depends: libx32quadmath0 (>= 4.9.3-13ubuntu2) but it is not going to be installed
lib32gcc-5-dev : Depends: libx32gomp1 (>= 5.4.0-6ubuntu1~16.04.5) but it is not going to be installed
Depends: libx32itm1 (>= 5.4.0-6ubuntu1~16.04.5) but it is not going to be installed
Depends: libx32atomic1 (>= 5.4.0-6ubuntu1~16.04.5) but it is not going to be installed
Depends: libx32asan2 (>= 5.4.0-6ubuntu1~16.04.5) but it is not going to be installed
Depends: libx32ubsan0 (>= 5.4.0-6ubuntu1~16.04.5) but it is not going to be installed
Depends: libx32cilkrts5 (>= 5.4.0-6ubuntu1~16.04.5) but it is not going to be installed
Depends: libx32quadmath0 (>= 5.4.0-6ubuntu1~16.04.5) but it is not going to be installed
lib64gcc-4.7-dev:i386 : Depends: libx32gcc1:i386 (>= 1:4.7.4-3ubuntu12) but it is not going to be installed
lib64gcc-4.8-dev:i386 : Depends: libx32gcc1:i386 (>= 1:4.8.5-4ubuntu2) but it is not going to be installed
Depends: libx32asan0:i386 (>= 4.8.5-4ubuntu2) but it is not going to be installed
lib64gcc-4.9-dev:i386 : Depends: libx32gcc1:i386 (>= 1:4.9.3-13ubuntu2) but it is not going to be installed
Depends: libx32asan1:i386 (>= 4.9.3-13ubuntu2) but it is not going to be installed
Depends: libx32ubsan0:i386 (>= 4.9.3-13ubuntu2) but it is not going to be installed
Depends: libx32cilkrts5:i386 (>= 4.9.3-13ubuntu2) but it is not going to be installed
lib64gcc-5-dev:i386 : Depends: libx32gcc1:i386 (>= 1:5.4.0-6ubuntu1~16.04.5) but it is not going to be installed
Depends: libx32asan2:i386 (>= 5.4.0-6ubuntu1~16.04.5) but it is not going to be installed
Depends: libx32ubsan0:i386 (>= 5.4.0-6ubuntu1~16.04.5) but it is not going to be installed
Depends: libx32cilkrts5:i386 (>= 5.4.0-6ubuntu1~16.04.5) but it is not going to be installed
libx32gcc-4.7-dev : Depends: libx32gomp1 (>= 4.7.4-3ubuntu12) but it is not going to be installed
Depends: libx32itm1 (>= 4.7.4-3ubuntu12) but it is not going to be installed
Depends: libx32quadmath0 (>= 4.7.4-3ubuntu12) but it is not going to be installed
libx32gcc-4.8-dev : Depends: libx32gomp1 (>= 4.8.5-4ubuntu2) but it is not going to be installed
Depends: libx32itm1 (>= 4.8.5-4ubuntu2) but it is not going to be installed
Depends: libx32atomic1 (>= 4.8.5-4ubuntu2) but it is not going to be installed
Depends: libx32asan0 (>= 4.8.5-4ubuntu2) but it is not going to be installed
Depends: libx32quadmath0 (>= 4.8.5-4ubuntu2) but it is not going to be installed
libx32gcc-4.9-dev : Depends: libx32gomp1 (>= 4.9.3-13ubuntu2) but it is not going to be installed
Depends: libx32itm1 (>= 4.9.3-13ubuntu2) but it is not going to be installed
Depends: libx32atomic1 (>= 4.9.3-13ubuntu2) but it is not going to be installed
Depends: libx32asan1 (>= 4.9.3-13ubuntu2) but it is not going to be installed
Depends: libx32ubsan0 (>= 4.9.3-13ubuntu2) but it is not going to be installed
Depends: libx32cilkrts5 (>= 4.9.3-13ubuntu2) but it is not going to be installed
Depends: libx32quadmath0 (>= 4.9.3-13ubuntu2) but it is not going to be installed
libx32gcc-5-dev : Depends: libx32gomp1 (>= 5.4.0-6ubuntu1~16.04.5) but it is not going to be installed
Depends: libx32itm1 (>= 5.4.0-6ubuntu1~16.04.5) but it is not going to be installed
Depends: libx32atomic1 (>= 5.4.0-6ubuntu1~16.04.5) but it is not going to be installed
Depends: libx32asan2 (>= 5.4.0-6ubuntu1~16.04.5) but it is not going to be installed
Depends: libx32ubsan0 (>= 5.4.0-6ubuntu1~16.04.5) but it is not going to be installed
Depends: libx32cilkrts5 (>= 5.4.0-6ubuntu1~16.04.5) but it is not going to be installed
Depends: libx32quadmath0 (>= 5.4.0-6ubuntu1~16.04.5) but it is not going to be installed
libx32gcc1 : Depends: libc6-x32 (>= 2.16) but it is not going to be installed
E: Unable to correct problems, you have held broken packages.
我怎样才能解决这个问题?
答案1
您需要安装该g++
软件包:
sudo apt install g++
(尝试安装gcc++
会产生奇怪的结果,因为与gcc++
包名称不匹配,因此apt-get
将其解释为正则表达式并尝试安装所有匹配的包,但它不能安装,因为它们相互冲突。)