【问题标题】:Yum Install Issue百胜安装问题
【发布时间】:2019-03-24 20:24:09
【问题描述】:

我正在尝试在 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++ rpm yum libstdc++


    【解决方案1】:

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

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

    【讨论】:

    • 由于我使用的是离线计算机,如何让 yum 连接到存储库?
    猜你喜欢
    • 2015-07-24
    • 2019-07-22
    • 1970-01-01
    • 2012-03-26
    • 2014-08-24
    • 2016-05-24
    • 2012-02-19
    • 1970-01-01
    • 2016-02-03
    相关资源
    最近更新 更多