一、配置网络YUM源
有的时候服务器需要下载一些软件,是本地yum源没有的,这时候需要配置网络yum源
#cd /etc/yum.repos.d/
把这个目录下的配置文件备份,改名;或者是把文件里边的enabled=1的改为enabled=0;
# wget -O /etc/yum.repos.d/CentOS-Base.repo http://mirrors.aliyun.com/repo/Centos-6.repo
# sed -i ‘s/$releasever/6/g’ /etc/yum.repos.d/CentOS-Base.repo
# yum clean all
# yum list
以上是配置RHEL6.5的,下边是配置 RHEL7.2
# wget -O /etc/yum.repos.d/CentOS-Base.repo
http://mirrors.aliyun.com/repo/Centos-7.repo
# sed -i ‘s/$releasever/7/g’ /etc/yum.repos.d/CentOS-Base.repo
# yum clean all
# yum list
参考链接:http://www.cnblogs.com/yanfeng-hb/p/6873046.html
二、配置过程中遇到的问题
安装网络yum源时遇到异常,
# wget -O /etc/yum.repos.d/CentOS-Base.repo
http://mirrors.aliyun.com/repo/Centos-7.repo
–2017-12-15 10:47:23–
http://mirrors.aliyun.com/repo/Centos-7.repo
Resolving mirrors.aliyun.com (mirrors.aliyun.com)… failed: Temporary failure in name resolution.
wget: unable to resolve host address ?.irrors.aliyun.com?
解决办法:
vi /etc/resolv.conf ,添加如下内容(默认里面什么都没有)
nameserver 8.8.8.8
nameserver 8.8.4.4
注:8.8.8.8和8.8.4.4是谷歌的公共DNS主服务器和备服务器。
转载于:https://www.cnblogs.com/jzhg/p/8989002.html