2021-05-12 14:32:11
安裝 gcc-c++ 時報錯和原有 gcc 版本衝突
CentOS 6.7 安裝 gcc-c++時報下面的錯誤:
Resolving Dependencies
--> Running transaction check
---> Package gcc-c++.i686 0:4.4.7-11.el6 will be installed
--> Processing Dependency: libstdc++-devel = 4.4.7-11.el6 for package: gcc-c++-4.4.7-11.el6.i686
--> Processing Dependency: gcc = 4.4.7-11.el6 for package: gcc-c++-4.4.7-11.el6.i686
--> Running transaction check
---> Package gcc-c++.i686 0:4.4.7-11.el6 will be installed
--> Processing Dependency: gcc = 4.4.7-11.el6 for package: gcc-c++-4.4.7-11.el6.i686
---> Package libstdc++-devel.i686 0:4.4.7-11.el6 will be installed
--> Finished Dependency Resolution
Error: Package: gcc-c++-4.4.7-11.el6.i686 (c6-media)
Requires: gcc = 4.4.7-11.el6
Installed: gcc-4.4.7-16.el6.i686 (@base)
gcc = 4.4.4-15.el6
gcc = 4.4.7-16.el6
Available: gcc-4.4.7-11.el6.i686 (c6-media)
gcc = 4.4.7-11.el6
gcc = 4.4.4-15.el6
You could try using --skip-broken to work around the problem
You could try running: rpm -Va --nofiles --nodigest
解決辦法:將 gcc,cpp, libgomp 等等依賴先刪除掉,然後重新直接安裝 gcc-c++,讓其自動安裝它的正確版本的依賴的 gcc, cpp, libgomp:
[root@localhost ~]# yum install gcc-c++
Loaded plugins: fastestmirror, refresh-packagekit, security
Setting up Install Process
Loading mirror speeds from cached hostfile
* c6-media:
Resolving Dependencies
--> Running transaction check
---> Package gcc-c++.i686 0:4.4.7-11.el6 will be installed
--> Processing Dependency: libstdc++-devel = 4.4.7-11.el6 for package: gcc-c++-4.4.7-11.el6.i686
--> Processing Dependency: gcc = 4.4.7-11.el6 for package: gcc-c++-4.4.7-11.el6.i686
--> Running transaction check
---> Package gcc.i686 0:4.4.7-11.el6 will be installed
--> Processing Dependency: libgomp = 4.4.7-11.el6 for package: gcc-4.4.7-11.el6.i686
--> Processing Dependency: cpp = 4.4.7-11.el6 for package: gcc-4.4.7-11.el6.i686
--> Processing Dependency: libgomp.so.1 for package: gcc-4.4.7-11.el6.i686
---> Package libstdc++-devel.i686 0:4.4.7-11.el6 will be installed
--> Running transaction check
---> Package cpp.i686 0:4.4.7-11.el6 will be installed
---> Package libgomp.i686 0:4.4.7-11.el6 will be installed
--> Finished Dependency Resolution
Dependencies Resolved
==========================================================================================================================================
Package Arch Version Repository Size
==========================================================================================================================================
Installing:
gcc-c++ i686 4.4.7-11.el6 c6-media 4.3 M
Installing for dependencies:
cpp i686 4.4.7-11.el6 c6-media 3.4 M
gcc i686 4.4.7-11.el6 c6-media 8.2 M
libgomp i686 4.4.7-11.el6 c6-media 135 k
libstdc++-devel i686 4.4.7-11.el6 c6-media 1.6 M
Transaction Summary
==========================================================================================================================================
Install 5 Package(s)
Total download size: 18 M
Installed size: 43 M
Is this ok [y/N]: y
Downloading Packages:
------------------------------------------------------------------------------------------------------------------------------------------
Total 21 MB/s | 18 MB 00:00
Running rpm_check_debug
Running Transaction Test
Transaction Test Succeeded
Running Transaction
Installing : libstdc++-devel-4.4.7-11.el6.i686 1/5
Installing : cpp-4.4.7-11.el6.i686 2/5
Installing : libgomp-4.4.7-11.el6.i686 3/5
Installing : gcc-4.4.7-11.el6.i686 4/5
Installing : gcc-c++-4.4.7-11.el6.i686 5/5
Unable to connect to dbus
Verifying : gcc-c++-4.4.7-11.el6.i686 1/5
Verifying : libgomp-4.4.7-11.el6.i686 2/5
Verifying : gcc-4.4.7-11.el6.i686 3/5
Verifying : libstdc++-devel-4.4.7-11.el6.i686 4/5
Verifying : cpp-4.4.7-11.el6.i686 5/5
Installed:
gcc-c++.i686 0:4.4.7-11.el6
Dependency Installed:
cpp.i686 0:4.4.7-11.el6 gcc.i686 0:4.4.7-11.el6 libgomp.i686 0:4.4.7-11.el6 libstdc++-devel.i686 0:4.4.7-11.el6
Complete!
[root@localhost ~]#
可以看到安裝 gcc-c++ 成功了。
Linux升級GCC 4.8.1清晰簡明教學(Ubuntu 12.04 64位元版為例) http://www.linuxidc.com/Linux/2014-04/99583.htm
在CentOS 6.4中編譯安裝GCC 4.8.1 + GDB 7.6.1 + Eclipse 在CentOS 6.4中編譯安裝GCC 4.8.1 + GDB 7.6.1 + Eclipse
Ubuntu下Vim+GCC+GDB安裝及使用 http://www.linuxidc.com/Linux/2013-01/78159.htm
Ubuntu???兩個GCC版本切換 http://www.linuxidc.com/Linux/2012-10/72284.htm
CentOS6.5升級手動安裝GCC4.8.2 http://www.linuxidc.com/Linux/2015-01/112595.htm
本文永久更新連結地址:http://www.linuxidc.com/Linux/2015-11/124943.htm
相關文章