修改CentOS yum源为北理源
作为先进生产力的代表,CentOS是大多数企业所采用的系统,可以通过yum源进行升级和应用安装,这里贴出改为可供校内访问的北理工镜像http://mirror.bit.edu.cn(在这给网络中心点个赞)
1.进入/etc/yum.repos.d/
1 | cd /etc/yum.repos.d/ |
2.将目录下所有repo文件备份
1 | mv CentOS-Base.repo CentOS-Base.repo.bak |
其他文件同理
3.创建新的CentOS-Base.repo
1 | yum CentOS-Base.repo |
然后贴入如下代码
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 | [base] name=CentOS-$releasever - Base baseurl=http://mirror.bit.edu.cn/centos/$releasever/os/$basearch/ gpgcheck=1 gpgkey=file:///etc/pki/rpm-gpg/RPM-GPG-KEY-CentOS-6 [updates] name=CentOS-$releasever - Updates baseurl=http://mirror.bit.edu.cn/centos/$releasever/updates/$basearch/ gpgcheck=1 gpgkey=file:///etc/pki/rpm-gpg/RPM-GPG-KEY-CentOS-6 [extras] name=CentOS-$releasever - Extras baseurl=http://mirror.bit.edu.cn/centos/$releasever/extras/$basearch/ gpgcheck=1 gpgkey=file:///etc/pki/rpm-gpg/RPM-GPG-KEY-CentOS-6 |
:wq保存退出
4.清除yum缓存并更新缓存使源立即生效
1 2 | yum clean all yum makecache |
共有 0 条评论