Centos6.5安装GCC遇到的问题及解决
2017-03-13 16:08
288 查看
以前安装gcc好像都很顺畅,但是今天不知道咋回事在一个centos系统的虚拟机上使用yum命令安装gcc的时候一直报错。
我执行的安装指令是:yum -y install gcc gcc-c++ kernel-devel
报错内容(部分):
Error Downloading Packages:
mpfr-2.4.1-6.el6.x86_64: failure: Packages/mpfr-2.4.1-6.el6.x86_64.rpm from base: [Errno 256] No more mirrors to try.
libgomp-4.4.7-17.el6.x86_64: failure: Packages/libgomp-4.4.7-17.el6.x86_64.rpm from base: [Errno 256] No more mirrors to try.
gcc-c++-4.4.7-17.el6.x86_64: failure: Packages/gcc-c++-4.4.7-17.el6.x86_64.rpm from base: [Errno 256] No more mirrors to try.
libgcc-4.4.7-17.el6.x86_64: failure: Packages/libgcc-4.4.7-17.el6.x86_64.rpm from base: [Errno 256] No more mirrors to try.
cpp-4.4.7-17.el6.x86_64: failure: Packages/cpp-4.4.7-17.el6.x86_64.rpm from base: [Errno 256] No more mirrors to try.
libstdc++-4.4.7-17.el6.x86_64: failure: Packages/libstdc++-4.4.7-17.el6.x86_64.rpm from base: [Errno 256] No more mirrors to try.
gcc-4.4.7-17.el6.x86_64: failure: Packages/gcc-4.4.7-17.el6.x86_64.rpm from base: [Errno 256] No more mirrors to try.
cloog-ppl-0.15.7-1.2.el6.x86_64: failure: Packages/cloog-ppl-0.15.7-1.2.el6.x86_64.rpm from base: [Errno 256] No more mirrors to try.
ppl-0.10.2-11.el6.x86_64: failure: Packages/ppl-0.10.2-11.el6.x86_64.rpm from base: [Errno 256] No more mirrors to try.
libstdc++-devel-4.4.7-17.el6.x86_64: failure: Packages/libstdc++-devel-4.4.7-17.el6.x86_64.rpm from base: [Errno 256] No more mirrors to try.
看报错的大意就是说,镜像找不到,即源没有找到;然后我就到网上搜了下,看可以用下面方法解决:
[Errno 256] No more mirrors to try. 得知这可能是错误的缓存源导致,直接两个命令解决:
yum clean all
yum makecache
但是我这里执行到 yum makecache 这个指令的时候还是又报错如下:
Could not retrieve mirrorlist http://mirrorlist.centos.org/?release=6&arch=x86_64&repo=os error was
14: PYCURL ERROR 6 - "Couldn't resolve host 'mirrorlist.centos.org'"
Error: Cannot retrieve repository metadata (repomd.xml) for repository: base. Please verify its path and try again
[root@app softback]# yum -y install gcc gcc-c++ kernel-devel
Could not retrieve mirrorlist http://mirrorlist.centos.org/?release=6&arch=x86_64&repo=os error was
14: PYCURL ERROR 6 - "Couldn't resolve host 'mirrorlist.centos.org'"
Error: Cannot retrieve repository metadata (repomd.xml) for repository: base. Please verify its path and try again
[root@app softback]# yum install gcc-c++ libstdc++-devel
Could not retrieve mirrorlist http://mirrorlist.centos.org/?release=6&arch=x86_64&repo=os error was
14: PYCURL ERROR 6 - "Couldn't resolve host 'mirrorlist.centos.org'"
Error: Cannot retrieve repository metadata (repomd.xml) for repository: base. Please verify its path and try again
国内服务器在运行命令yum -y install wget的时候会出现这种问题,
这种错误,是因为没有配置/etc/resolv.conf。
解决方法:编辑resolv.conf文件,添加:nameserver 8.8.8.8
然后保存退出即可。
然后在执行 yum makecache 指令,等该指令结束后再执行安装gcc指令,就可以安装成功了!
我执行的安装指令是:yum -y install gcc gcc-c++ kernel-devel
报错内容(部分):
Error Downloading Packages:
mpfr-2.4.1-6.el6.x86_64: failure: Packages/mpfr-2.4.1-6.el6.x86_64.rpm from base: [Errno 256] No more mirrors to try.
libgomp-4.4.7-17.el6.x86_64: failure: Packages/libgomp-4.4.7-17.el6.x86_64.rpm from base: [Errno 256] No more mirrors to try.
gcc-c++-4.4.7-17.el6.x86_64: failure: Packages/gcc-c++-4.4.7-17.el6.x86_64.rpm from base: [Errno 256] No more mirrors to try.
libgcc-4.4.7-17.el6.x86_64: failure: Packages/libgcc-4.4.7-17.el6.x86_64.rpm from base: [Errno 256] No more mirrors to try.
cpp-4.4.7-17.el6.x86_64: failure: Packages/cpp-4.4.7-17.el6.x86_64.rpm from base: [Errno 256] No more mirrors to try.
libstdc++-4.4.7-17.el6.x86_64: failure: Packages/libstdc++-4.4.7-17.el6.x86_64.rpm from base: [Errno 256] No more mirrors to try.
gcc-4.4.7-17.el6.x86_64: failure: Packages/gcc-4.4.7-17.el6.x86_64.rpm from base: [Errno 256] No more mirrors to try.
cloog-ppl-0.15.7-1.2.el6.x86_64: failure: Packages/cloog-ppl-0.15.7-1.2.el6.x86_64.rpm from base: [Errno 256] No more mirrors to try.
ppl-0.10.2-11.el6.x86_64: failure: Packages/ppl-0.10.2-11.el6.x86_64.rpm from base: [Errno 256] No more mirrors to try.
libstdc++-devel-4.4.7-17.el6.x86_64: failure: Packages/libstdc++-devel-4.4.7-17.el6.x86_64.rpm from base: [Errno 256] No more mirrors to try.
看报错的大意就是说,镜像找不到,即源没有找到;然后我就到网上搜了下,看可以用下面方法解决:
[Errno 256] No more mirrors to try. 得知这可能是错误的缓存源导致,直接两个命令解决:
yum clean all
yum makecache
但是我这里执行到 yum makecache 这个指令的时候还是又报错如下:
Could not retrieve mirrorlist http://mirrorlist.centos.org/?release=6&arch=x86_64&repo=os error was
14: PYCURL ERROR 6 - "Couldn't resolve host 'mirrorlist.centos.org'"
Error: Cannot retrieve repository metadata (repomd.xml) for repository: base. Please verify its path and try again
[root@app softback]# yum -y install gcc gcc-c++ kernel-devel
Could not retrieve mirrorlist http://mirrorlist.centos.org/?release=6&arch=x86_64&repo=os error was
14: PYCURL ERROR 6 - "Couldn't resolve host 'mirrorlist.centos.org'"
Error: Cannot retrieve repository metadata (repomd.xml) for repository: base. Please verify its path and try again
[root@app softback]# yum install gcc-c++ libstdc++-devel
Could not retrieve mirrorlist http://mirrorlist.centos.org/?release=6&arch=x86_64&repo=os error was
14: PYCURL ERROR 6 - "Couldn't resolve host 'mirrorlist.centos.org'"
Error: Cannot retrieve repository metadata (repomd.xml) for repository: base. Please verify its path and try again
国内服务器在运行命令yum -y install wget的时候会出现这种问题,
这种错误,是因为没有配置/etc/resolv.conf。
解决方法:编辑resolv.conf文件,添加:nameserver 8.8.8.8
然后保存退出即可。
然后在执行 yum makecache 指令,等该指令结束后再执行安装gcc指令,就可以安装成功了!
相关文章推荐
- centos6.5搭建git服务器 win10 安装git客户端连接 和遇到的问题+解决方式
- 虚拟机上Linux系统安装VMware tools 时遇到的问题解决办法(VM10,CentOS6.5)
- Centos6.5(final)安装gcc和g++,python以及导致问题的解决方法
- [转]Centos6.5+CUDA6.5+caffe安装配置及可能遇到问题解答
- centos 6.5安装ftp及问题解决
- CentOS安装GCC--解决依赖问题
- kafka+zookeeper集群安装与配置(CENTOS7环境)及开发中遇到的问题解决
- 在CentOS6.5中安装MySQL及遇到的问题Can't open the mysql.plugin table.
- CentOS6.4 安装oracle11g的遇到的问题以及解决方法
- CentOS安装teamviewer遇到依赖包问题及完美解决
- 解决redis在centos自带ruby版本太低问题centos 6.5 ruby环境安装2.2+
- win10安装centos双系统,遇到问题及解决方法
- centos 安装mysql中遇到问题的解决办法
- centos安装mysqldb遇到的问题和解决方法
- CentOS 6.5安装MySQL中文乱码问题解决
- Centos6.5离线配置CDH5.1心得和遇到的问题(已安装成功)
- CentOS6.5安装mysql中文乱码问题解决
- CentOS 6.5安装caffe注意事项 应该可以解决大部分报错问题
- CentOS6.5上python-mysql环境的安装问题解决
- centos 6.2升级6.5遇到的问题及解决方法