1如何使用代理上网,设置代理IP
export http_proxy=''
2备份源文件
mv /etc/yum.repos.d/CentOS-Base.repo /etc/yum.repos.d/CentOS-Base.repo.bac
3 下载新的CentOS-Base.repo
wget -O /etc/yum.repos.d/CentOS-Base.repo http://mirrors.163.com/.help/CentOS6-Base-163.repo
4 运行yum makecache
生成缓存
yum clean all
yum makecache
若出现这个错误:
Retrieving key from http://mirror.centos.org/centos/RPM-GPG-KEY-CentOS-6
运行该命令:
rpm –import /etc/pki/rpm-gpg/RPM-GPG-KEY-CentOS-6