linux yum baseurl,Linux系统yum安装报错Cannot find a valid baseurl for repo的解决方法

yum install error

[root@localhost cmake-3.2.2]# yum install gcc

Loaded plugins: fastestmirror, refresh-packagekit, security

Could not retrieve mirrorlist 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@localhost cmake-3.2.2]# yum install gcc-c++

Loaded plugins: fastestmirror, refresh-packagekit, security

Determining fastest mirrors

Could not retrieve mirrorlist error was

14: PYCURL ERROR 6 - "Couldn't resolve host 'mirrorlist.centos.org'"

Error: Cannot find a valid baseurl for repo: base

解决方法如下(修改dns配置)

vi /etc/resolv.conf

在此文件最后加入:nameserver 114.114.114.114

再次安装正常:

[root@localhost cmake-3.2.2]# yum install gcc

Loaded plugins: fastestmirror, refresh-packagekit, security

Loading mirror speeds from cached hostfile

* base: mirrors.tuna.tsinghua.edu.cn

* extras: mirrors.btte.net

* updates: mirrors.tuna.tsinghua.edu.cn

Setting up Install Process

Resolving Dependencies

--> Running transaction check

---> Package gcc.x86_64 0:4.4.7-17.el6 will be installed

--> Processing Dependency: libgomp = 4.4.7-17.el6 for package: gcc-4.4.7-17.el6.x86_64

--> Processing Dependency: cpp = 4.4.7-17.el6 for package: gcc-4.4.7-17.el6.x86_64

--> Processing Dependency: libgcc >= 4.4.7-17.el6 for package: gcc-4.4.7-17.el6.x86_64

--> Processing Dependency: cloog-ppl >= 0.15 for package: gcc-4.4.7-17.el6.x86_64

--> Running transaction check

---> Package cloog-ppl.x86_64 0:0.15.7-1.2.el6 will be installed

--> Processing Dependency: libppl_c.so.2()(64bit) for package: cloog-ppl-0.15.7-1.2.el6.x86_64

--> Processing Dependency: libppl.so.7()(64bit) for package: cloog-ppl-0.15.7-1.2.el6.x86_64

---> Package cpp.x86_64 0:4.4.7-17.el6 will be installed

--> Processing Dependency: libmpfr.so.1()(64bit) for package: cpp-4.4.7-17.el6.x86_64

---> Package libgcc.i686 0:4.4.7-4.el6 will be updated

---> Package libgcc.x86_64 0:4.4.7-4.el6 will be updated

---> Package libgcc.i686 0:4.4.7-17.el6 will be an update

---> Package libgcc.x86_64 0:4.4.7-17.el6 will be an update

---> Package libgomp.x86_64 0:4.4.7-4.el6 will be updated

---> Package libgomp.x86_64 0:4.4.7-17.el6 will be an update

--> Running transaction check

---> Package mpfr.x86_64 0:2.4.1-6.el6 will be installed

---> Package ppl.x86_64 0:0.10.2-11.el6 will be installed

--> Finished Dependency Resolution

Dependencies Resolved

==============================================================================================================================================

Package                           Arch                           Version                                  Repository                    Size

==============================================================================================================================================

Installing:

gcc                               x86_64                         4.4.7-17.el6                             base                          10 M

Installing for dependencies:

cloog-ppl                         x86_64                         0.15.7-1.2.el6                           base                          93 k

cpp                               x86_64                         4.4.7-17.el6                             base                         3.7 M

mpfr                              x86_64                         2.4.1-6.el6                              base                         157 k

ppl                               x86_64                         0.10.2-11.el6                            base                         1.3 M

Updating for dependencies:

libgcc                            i686                           4.4.7-17.el6                             base                         114 k

libgcc                            x86_64                         4.4.7-17.el6                             base                         103 k

libgomp                           x86_64                         4.4.7-17.el6                             base                         134 k

Transaction Summary

==============================================================================================================================================

Install       5 Package(s)

Upgrade       3 Package(s)

Total download size: 16 M

Is this ok [y/N]:

来自 “ ITPUB博客 ” ,链接:http://blog.itpub.net/15498/viewspace-2135089/,如需转载,请注明出处,否则将追究法律责任。

评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值