一个直来直去的人,被生活折磨的弯弯曲曲。
分类: 系统运维
2013-10-15 17:22:50
国内镜像地址:
。(网易)
我们就用 网易)来修改配置文件
方法一:
#先备份配置文件
cp /etc/yum.repos.d/CentOS-Base.repo /etc/yum.repos.d/CentOS-Base.repo.save
#修改配置文件(安(i)键 进入插入模式进行修改)
vi /etc/yum.repos.d/CentOS-Base.repo
#配置文件如下修改:
# CentOS-Base.repo # # The mirror system uses the connecting IP address of the client and the # update status of each mirror to pick mirrors that are updated to and # geographically close to the client. You should use this for CentOS updates # unless you are manually picking other mirrors. # # If the mirrorlist= does not work for you, as a fall back you can try the # remarked out baseurl= line instead. # # [base] name=CentOS-$releasever - Base - 163.com mirrorlist= baseurl= gpgcheck=1 gpgkey=file:///etc/pki/rpm-gpg/RPM-GPG-KEY-CentOS-5 #released updates [updates] name=CentOS-$releasever - Updates - 163.com mirrorlist= baseurl= gpgcheck=1 gpgkey=file:///etc/pki/rpm-gpg/RPM-GPG-KEY-CentOS-5 #packages used/produced in the build but not released [addons] name=CentOS-$releasever - Addons - 163.com mirrorlist= baseurl= gpgcheck=1 gpgkey=file:///etc/pki/rpm-gpg/RPM-GPG-KEY-CentOS-5 #additional packages that may be useful [extras] name=CentOS-$releasever - Extras - 163.com mirrorlist= baseurl= gpgcheck=1 gpgkey=file:///etc/pki/rpm-gpg/RPM-GPG-KEY-CentOS-5 #additional packages that extend functionality of existing packages [centosplus] name=CentOS-$releasever - Plus - 163.com mirrorlist= baseurl= gpgcheck=1 enabled=0 gpgkey=file:///etc/pki/rpm-gpg/RPM-GPG-KEY-CentOS-5 #contrib - packages by Centos Users [contrib] name=CentOS-$releasever - Contrib - 163.com mirrorlist= baseurl= gpgcheck=1 enabled=0 gpgkey=file:///etc/pki/rpm-gpg/RPM-GPG-KEY-CentOS-5#修改完成后 安 (ESC)键 退出 插入模式 输入 (:wq) 保存退出
上面的修改就是把mirrorlist注释掉,将baseurl改成ustc.edu.cn的镜像地址。
方法二:
#先备份配置文件
cd /etc/yum.repos.d/
mv CentOS-Base.repo CentOS-Base.repo.save
wget
mv CentOS-Base-163.repo CentOS-Base.repo