gcc与c++安装遇到rpm依赖包错误

发布于 2021-11-29 12:31:05 字数 2690 浏览 993 评论 5

centOS6.5下  安装pcre-8.38时,报没有安装gcc环境,  我去网上下载rpm包依次安装  但是到 安装libgomp,cpp时都报依赖错误,麻烦大神帮忙看下  而且 前面试装docker的时候修改过yum的配置文件 yum下载也不好使了  谢谢各位。
[root@lsm121 pcre-8.38]# ./configure
...
checking windows.h presence... no
checking for windows.h... no
configure: error: You need a C++ compiler for C++ support.
[root@lsm121 local]# rpm -Uvh libgomp-4.4.7-4.el6.x86_64.rpm 
error: Failed dependencies:
	libgomp = 4.4.7-16.el6 is needed by (installed) gcc-4.4.7-16.el6.x86_64
[root@lsm121 local]# rpm -Uvh gcc-4.4.7-4.el6.x86_64.rpm 
error: Failed dependencies:
	cpp = 4.4.7-4.el6 is needed by gcc-4.4.7-4.el6.x86_64
	libgomp = 4.4.7-4.el6 is needed by gcc-4.4.7-4.el6.x86_64
[root@lsm121 local]# rpm -Uvh cpp-4.4.7-4.el6.x86_64.rpm 
error: Failed dependencies:
	cpp = 4.4.7-16.el6 is needed by (installed) gcc-4.4.7-16.el6.x86_64
[root@lsm121 local]# rpm -Uvh gcc-c++-4.4.7-4.el6.x86_64.rpm 
error: Failed dependencies:
	gcc = 4.4.7-4.el6 is needed by gcc-c++-4.4.7-4.el6.x86_64
[root@lsm121 local]# rpm -Uvh cpp-4.4.7-4.el6.x86_64.rpm 
error: Failed dependencies:
	cpp = 4.4.7-16.el6 is needed by (installed) gcc-4.4.7-16.el6.x86_64
[root@lsm121 local]# rpm -ivh cpp-4.4.7-4.el6.x86_64.rpm 
Preparing...                ########################################### [100%]
	package cpp-4.4.7-16.el6.x86_64 (which is newer than cpp-4.4.7-4.el6.x86_64) is already installed
	file /usr/bin/cpp from install of cpp-4.4.7-4.el6.x86_64 conflicts with file from package cpp-4.4.7-16.el6.x86_64
	file /usr/libexec/gcc/x86_64-redhat-linux/4.4.4/cc1 from install of cpp-4.4.7-4.el6.x86_64 conflicts with file from package cpp-4.4.7-16.el6.x86_64
[root@lsm121 local]# rpm -ivh libgomp-4.4.7-4.el6.x86_64.rpm 
Preparing...                ########################################### [100%]
	package libgomp-4.4.7-16.el6.x86_64 (which is newer than libgomp-4.4.7-4.el6.x86_64) is already installed
	file /usr/lib64/libgomp.so.1.0.0 from install of libgomp-4.4.7-4.el6.x86_64 conflicts with file from package libgomp-4.4.7-16.el6.x86_64
[root@lsm121 local]# rpm -Uvh gcc-4.4.7-4.el6.x86_64.rpm 
error: Failed dependencies:
	cpp = 4.4.7-4.el6 is needed by gcc-4.4.7-4.el6.x86_64
	libgomp = 4.4.7-4.el6 is needed by gcc-4.4.7-4.el6.x86_64
[root@lsm121 local]# rpm -ivh gcc-4.4.7-4.el6.x86_64.rpm 
error: Failed dependencies:
	cpp = 4.4.7-4.el6 is needed by gcc-4.4.7-4.el6.x86_64
	libgomp = 4.4.7-4.el6 is needed by gcc-4.4.7-4.el6.x86_64
[root@lsm121 local]# rpm -i gcc
error: open of gcc failed: No such file or directory
[root@lsm121 local]# yum install gcc
Setting up Install Process
Nothing to do



如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(5

德意的啸 2021-12-03 23:12:33

--node-force这种方式不推荐,虽然可以安装gcc&c++,但以后使用的时候,会发生许多莫名其貌的问题,最后花时间调查发现原来是gcc&c++安装不正确导致的。

你可以去你的centOS6.5的ISO镜像文件中,找到package下gcc&c++的rpm包,解压出来后直接安装即可。

筱武穆 2021-12-03 23:11:26

引用来自“鲁小鹿”的评论

yum源修复方式:https://lug.ustc.edu.cn/wiki/mirrors/help/centos (使用国内的源下载速度会快点) 下载对应的centos版本

然后放置在/etc/yum.repos.d下,yum makecache一下,如果系统装有wget,直接wget下载也可

[xiaolu@lucia root]$ cd /etc/yum.repos.d/
[xiaolu@lucia yum.repos.d]$ sudo mv CentOS-Base.repo CentOS-Base.repo.bak
[xiaolu@lucia yum.repos.d]$ sudo wget -O CentOS-Base.repo https://lug.ustc.edu.cn/wiki/_export/code/mirrors/help/centos?codeblock=2  
[xiaolu@lucia yum.repos.d]$ yum makecache

你的./configure 报错很明显的报错了You need a C++ compilerfor
C++ support

[root@lsm121 local]# rpm -Uvh gcc-4.4.7-4.el6.x86_64.rpm 
error: Failed dependencies:
    cpp = 4.4.7-4.el6 is needed by gcc-4.4.7-4.el6.x86_64
    libgomp = 4.4.7-4.el6 is needed by gcc-4.4.7-4.el6.x86_64

第一层楼里面你写的是安装gcc及gcc的依赖包(然后都报的依赖包的错误)

有两种方式:

修复yum,你可以直接yum安装

不修复yum源,你安装gcc及其他依赖包的时候,加上参数 --force --nodeps

例如:

rpm -Uvh gcc-4.4.7-4.el6.x86_64.rpm --nodeps --force

回眸一笑 2021-12-03 23:00:44

我最先是在网上看的  这样安装的

[root@lsm121 local]# rpm -Uvh kernel-headers-2.6.32-431.el6.x86_64.rpm
Preparing...                ########################################### [100%]
	package kernel-headers-2.6.32-431.el6.x86_64 is already installed
[root@lsm121 local]# rpm -Uvh glibc-headers-2.12-1.132.el6.x86_64.rpm
Preparing...                ########################################### [100%]
	package glibc-headers-2.12-1.132.el6.x86_64 is already installed
[root@lsm121 local]# rpm -Uvh glibc-devel-2.12-1.132.el6.x86_64.rpm
Preparing...                ########################################### [100%]
	package glibc-devel-2.12-1.132.el6.x86_64 is already installed
[root@lsm121 local]# rpm -Uvh libgomp-4.4.7-4.el6.x86_64.rpm
error: Failed dependencies:
	libgomp = 4.4.7-16.el6 is needed by (installed) gcc-4.4.7-16.el6.x86_64
[root@lsm121 local]# rpm -Uvh ppl-0.10.2-11.el6.x86_64.rpm
Preparing...                ########################################### [100%]
	package ppl-0.10.2-11.el6.x86_64 is already installed
[root@lsm121 local]# rpm -Uvh cloog-ppl-0.15.7-1.2.el6.x86_64.rpm
Preparing...                ########################################### [100%]
	package cloog-ppl-0.15.7-1.2.el6.x86_64 is already installed
[root@lsm121 local]# rpm -Uvh mpfr-2.4.1-6.el6.x86_64.rpm
Preparing...                ########################################### [100%]
	package mpfr-2.4.1-6.el6.x86_64 is already installed
[root@lsm121 local]# rpm -Uvh cpp-4.4.7-4.el6.x86_64.rpm
error: Failed dependencies:
	cpp = 4.4.7-16.el6 is needed by (installed) gcc-4.4.7-16.el6.x86_64
[root@lsm121 local]# rpm -Uvh gcc-4.4.7-4.el6.x86_64.rpm
error: Failed dependencies:
	cpp = 4.4.7-4.el6 is needed by gcc-4.4.7-4.el6.x86_64
	libgomp = 4.4.7-4.el6 is needed by gcc-4.4.7-4.el6.x86_64
[root@lsm121 local]# pm -Uvh libgomp-4.4.7-4.el6.x86_64.rpm
-bash: pm: command not found
[root@lsm121 local]# rpm -Uvh libgomp-4.4.7-4.el6.x86_64.rpm
error: Failed dependencies:
	libgomp = 4.4.7-16.el6 is needed by (installed) gcc-4.4.7-16.el6.x86_64
[root@lsm121 local]# rpm -Uvh libstdc++-devel-4.4.7-4.el6.x86_64.rpm
Preparing...                ########################################### [100%]
   1:libstdc++-devel        ########################################### [100%]

感情旳空白 2021-12-03 22:58:47

谢谢 从你的回答里又学到了很多东西

岁吢 2021-12-03 06:26:11

yum源修复方式:https://lug.ustc.edu.cn/wiki/mirrors/help/centos (使用国内的源下载速度会快点) 下载对应的centos版本

然后放置在/etc/yum.repos.d下,yum makecache一下,如果系统装有wget,直接wget下载也可

[xiaolu@lucia root]$ cd /etc/yum.repos.d/
[xiaolu@lucia yum.repos.d]$ sudo mv CentOS-Base.repo CentOS-Base.repo.bak
[xiaolu@lucia yum.repos.d]$ sudo wget -O CentOS-Base.repo https://lug.ustc.edu.cn/wiki/_export/code/mirrors/help/centos?codeblock=2  
[xiaolu@lucia yum.repos.d]$ yum makecache

你的./configure 报错很明显的报错了You need a C++ compilerfor
C++ support

[root@lsm121 local]# rpm -Uvh gcc-4.4.7-4.el6.x86_64.rpm 
error: Failed dependencies:
    cpp = 4.4.7-4.el6 is needed by gcc-4.4.7-4.el6.x86_64
    libgomp = 4.4.7-4.el6 is needed by gcc-4.4.7-4.el6.x86_64

第一层楼里面你写的是安装gcc及gcc的依赖包(然后都报的依赖包的错误)

有两种方式:

修复yum,你可以直接yum安装

不修复yum源,你安装gcc及其他依赖包的时候,加上参数 --force --nodeps

例如:

rpm -Uvh gcc-4.4.7-4.el6.x86_64.rpm --nodeps --force

~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文