本文内容过于古老而缺少价值,CentOS repo相关信息,请参考此处.

新安装CentOS 6.2 * 1 添加上海交大源*1 yum 的.repo文件如下:

[CentOS-ftp.sjtu.edu.cn]
name=CentOS 6
baseurl=http://ftp.sjtu.edu.cn/centos/6/os/$basearch/
enabled=1
gpgcheck=0
gpgkey=http://ftp.sjtu.edu.cn/centos/6/os/$basearch/RPM-GPG-KEY-CentOS-6

[updates-ftp.sjtu.edu.cn]
name=CentOS updates
#baseurl=http://ftp.sjtu.edu.cn/centos/6/updates/$basearch/
baseurl=http://ftp.sjtu.edu.cn/centos/6/updates/$basearch/
enabled=1
gpgcheck=0
gpgkey=http://ftp.sjtu.edu.cn/centos/RPM-GPG-KEY-CentOS-6

[extras-ftp.sjtu.edu.cn]
name=CentOS-6-Extras
baseurl=http://ftp.sjtu.edu.cn/centos/6/extras/$basearch/
gpgcheck=0
gpgkey=http://ftp.sjtu.edu.cn/centos/RPM-GPG-KEY-CentOS-6

[centosplus-ftp.sjtu.edu.cn]
name=CentOS-6-Plus
baseurl=http://ftp.sjtu.edu.cn/centos/6/centosplus/$basearch/
gpgcheck=0
enabled=0
gpgkey=http://ftp.sjtu.edu.cn/centos/RPM-GPG-KEY-CentOS-6

[contrib-ftp.sjtu.edu.cn]
name=CentOS-6-Contrib
baseurl=http://ftp.sjtu.edu.cn/centos/6/contrib/$basearch/
gpgcheck=0
enabled=0
gpgkey=http://ftp.sjtu.edu.cn/centos/RPM-GPG-KEY-CentOS-6

[fasttrack-ftp.sjtu.edu.cn]
name=CentOS-6-fasttrack
baseurl=http://ftp.sjtu.edu.cn/centos/6/fasttrack/$basearch/
gpgcheck=0
enabled=0
gpgkey=http://ftp.sjtu.edu.cn/centos/RPM-GPG-KEY-CentOS-6

用法: 保存为 sjtu.repo (或者 xxxx.repo) terminal进入repo文件所在文件夹

sudo cp *.repo /etc/yum.repos.d/

有了上交的东西,可以删掉它自带的源了

su
cd /etc/yum.repos.d/
ls -al

按自己要求删吧

完了之后记得重新生成cache

yum makecache

有时候需要清空重来

yum clean all
yum makecache

这东西挺简单的,毕竟工具嘛 随意发挥好了

来自的你,很高兴你能看到这儿。若本文对你有所用处,或者内容有什么不足之处,敬请毫不犹豫给个回复。谢谢!