背景:CentOS 6.9为最小化安装
1.用yum安装软件报错
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’
#这种错误是因为网络问题,没有配置/etc/resolv.conf,在这个文件里写入nameserver 8.8.8.8即可.
#yum -y install wget 安装好wget
2.在CentOS6上配置Base源
#备份你的原镜像文件,出错后还可以恢复
mv /etc/yum.repos.d/CentOS-Base.repo /etc/yum.repos.d/CentOS-Base.repo.backup
#wget -O /etc/yum.repos.d/CentOS-Base.repo http://mirrors.aliyun.com/repo/Centos-6.repo
下载新的CentOS-Base.repo到/etc/yum.repos.d/
yum makecache # 生成缓存
yum clean all # 清除缓存
3.在CentOS6上配置EPEL源
yum -y install epel-release
4.查看源
#yum repolist