安装外网的yum步骤
cd /etc/yum.repos.d/
touch my.repo
vi /etc/yum.repos.d/my.repo
[base]
name=centos6.3
baseurl=http://mirrors.163.com/centos/$releasever/os/$basearch
gpgecheck=0
enable=1
gpgkey=http://mirrors.163.com/centos/RPM-GPG-KEY-CentOS-6
保存退出
然后yum clean all(清空yum),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‘"
于是就各种找答案,各种尝试,最后发现是DNS的问题,
vi /etc/resolv.conf文件添加如下
nameserver 8.8.8.8(你自己的DNS服务器)
然后重新yum makecache即可成功
本文出自 “沐木” 博客,请务必保留此出处http://sxhxt.blog.51cto.com/5126000/1913477
原文地址:http://sxhxt.blog.51cto.com/5126000/1913477