私はコンピュータサイエンスの学生で、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