首页 > 解决方案 > 百胜安装问题

问题描述

我正在尝试在 Redhat Linux 6 机器上安装 g++ 4.1.2(似乎已经安装了 gcc 4.1.2)。当我第一次尝试通过 yum 运行 gcc-c++-4.1.2 rpm 时,我得到以下依赖问题,

[root@Cham1WS Desktop]# yum install gcc-c++-4.1.2-55.el5.x86_64.rpm 
Setting up Install Process 
Examining gcc-c++-4.1.2-55.el5.x86_64.rpm: gcc-c++-4.1.2-55.el5.x86_64 
Marking gcc-c++-4.1.2-55.el5.x86_64.rpm to be installed 
Resolving Dependencies 
--> Running transaction check 
---> Package gcc-c++.x86_64 0:4.1.2-55.el5 will be installed 
--> Processing Dependency: libstdc++ = 4.1.2-55.el5 for package: gcc-c++-  4.1.2-55.el5.x86_64 
--> Processing Dependency: libstdc++-devel = 4.1.2-55.el5 for package: gcc-c++-4.1.2-55.el5.x86_64 
--> Finished Dependency Resolution 
Error: Package: gcc-c++-4.1.2-55.el5.x86_64 (/gcc-c++-4.1.2-55.el5.x86_64) 
       Requires: libstdc++-devel = 4.1.2-55.el5 
Error: Package: gcc-c++-4.1.2-55.el5.x86_64 (/gcc-c++-4.1.2-55.el5.x86_64) 
       Requires: libstdc++ = 4.1.2-55.el5 
       Installed: libstdc++-4.4.7-16.el6.x86_64 (@anaconda-   RedHatEnterpriseLinux-201507020259.x86_64/6.7) 
           libstdc++ = 4.4.4-15.el6 
           libstdc++ = 4.4.7-16.el6 
 You could try using --skip-broken to work around the problem 
 You could try running: rpm -Va --nofiles --nodigest 

所以,看来我需要安装 libstdc++-devel-4.1.2-55.el5.x86_64.rpm。所以我尝试安装它,我得到了以下依赖项,

[root@Cham1WS Desktop]# yum install libstdc++-devel-4.1.2-55.el5.x86_64.rpm 
Setting up Install Process 
Examining libstdc++-devel-4.1.2-55.el5.x86_64.rpm: libstdc++-devel-4.1.2-55.el5.x86_64 
Marking libstdc++-devel-4.1.2-55.el5.x86_64.rpm to be installed 
Resolving Dependencies 
--> Running transaction check 
---> Package libstdc++-devel.x86_64 0:4.1.2-55.el5 will be installed 
--> Processing Dependency: libstdc++ = 4.1.2-55.el5 for package: libstdc++-devel-4.1.2-55.el5.x86_64 
--> Finished Dependency Resolution 
Error: Package: libstdc++-devel-4.1.2-55.el5.x86_64 (/libstdc++-devel-4.1.2-55.el5.x86_64) 
       Requires: libstdc++ = 4.1.2-55.el5 
       Installed: libstdc++-4.4.7-16.el6.x86_64 (@anaconda-RedHatEnterpriseLinux-201507020259.x86_64/6.7) 
           libstdc++ = 4.4.4-15.el6 
           libstdc++ = 4.4.7-16.el6 
You could try using --skip-broken to work around the problem 
You could try running: rpm -Va --nofiles --nodigest 

似乎已经安装了较早版本的 libstdc++。无论如何,我尝试安装 libstdc++-4.1.2-55.el5.x86_64.rpm (不是“devel”),它说它已经安装了。

[root@Cham1WS Desktop]# yum install libstdc++-4.1.2-55.el5.x86_64.rpm 
Setting up Install Process 
Examining libstdc++-4.1.2-55.el5.x86_64.rpm: libstdc++-4.1.2-55.el5.x86_64 
libstdc++-4.1.2-55.el5.x86_64.rpm: does not update installed package. 
Error: Nothing to do

但是,如果我尝试安装“libstdc++-devel-4.1.2-55.el5.x86_64.rpm”,我会再次获得更早的依赖项。似乎问题是我已经安装了更新版本的 libstdc++

1)我该如何解决这个问题?2)我需要卸载更高版本的libstdc++吗?

标签: g++rpmyumlibstdc++

解决方案


看来你用yum错了方法:你应该让 yum 连接到一些存储库,让他找出依赖关系。

顺便说一句,您正在安装el5软件包,这意味着 centos5 的软件包,而不是 centos6。尝试寻找类似的软件包,但对于 centos6,那会更好;尝试使用可能对您有帮助的epel存储库(查看如何启用它:https ://www.tecmint.com/how-to-enable-epel-repository-for-rhel-centos-6-5/ )


推荐阅读