使用CentOS下载软件时,发现源不可使用,解决:
一,
将/etc/yum.repos.d/下面所有的源给删除掉了
二,
更新国内源,下载镜像
# CentOS 5
wget -O /etc/yum.repos.d/CentOS-Base.repo http://mirrors.aliyun.com/repo/Centos-5.repo
# CentOS 6
wget -O /etc/yum.repos.d/CentOS-Base.repo http://mirrors.aliyun.com/repo/Centos-6.repo
# CentOS 7
wget -O /etc/yum.repos.d/CentOS-Base.repo http://mirrors.aliyun.com/repo/Centos-7.repo
三,
重新生成缓存
3)yum clean all #清空缓存
4)yum makecache #重新生成缓存