首页  编辑  

Redhat 6.1和5.x更改Yum源

Tags: /计算机文档/Linux & Unix/   Date Created:

Redhat 6.1,运行以下脚本即可:

rpm -aq|grep yum|xargs rpm -e --nodeps

wget http://mirrors.163.com/centos/6/os/x86_64/Packages/python-iniparse-0.3.1-2.1.el6.noarch.rpm

wget http://mirrors.163.com/centos/6/os/x86_64/Packages/yum-metadata-parser-1.1.2-16.el6.x86_64.rpm

wget http://mirrors.163.com/centos/6/os/x86_64/Packages/yum-3.2.29-40.el6.centos.noarch.rpm

wget http://mirrors.163.com/centos/6/os/x86_64/Packages/yum-plugin-fastestmirror-1.1.30-14.el6.noarch.rpm

rpm -ivh python-iniparse-0.3.1-2.1.el6.noarch.rpm

rpm -ivh yum-metadata-parser-1.1.2-16.el6.x86_64.rpm

rpm -ivh yum-3.2.29-40.el6.centos.noarch.rpm yum-plugin-fastestmirror-1.1.30-14.el6.noarch.rpm

cd /etc/yum.repos.d/

wget http://mirrors.163.com/.help/CentOS6-Base-163.repo

yum clean all

yum makecache

rpm --import http://elrepo.org/RPM-GPG-KEY-elrepo.org

rpm -Uvh http://elrepo.org/elrepo-release-6-4.el6.elrepo.noarch.rpm

rpm -Uvh http://download.fedoraproject.org/pub/epel/6/i386/epel-release-6-5.noarch.rpm

rpm -Uvh http://pkgs.repoforge.org/rpmforge-release/rpmforge-release-0.5.2-2.el6.rf.i686.rpm

运行完成后,修改 /etc/yum.repos.d/CentOS6-Base-163.repo ,把其中的$releasever替换为你的OS的版本,例如6,好像Redhat不支持这个变量

http://mirrors.163.com/centos/6/os/x86_64/repodata/repomd.xml

Redhat 5.6的:

rpm -aq|grep yum|xargs rpm -e --nodeps

wget http://centos.ustc.edu.cn/centos/5/os/x86_64/CentOS/python-iniparse-0.2.3-6.el5.noarch.rpm

wget http://centos.ustc.edu.cn/centos/5/os/x86_64/CentOS/yum-updatesd-0.9-5.el5.noarch.rpm

wget http://centos.ustc.edu.cn/centos/5/os/x86_64/CentOS/yum-metadata-parser-1.1.2-4.el5.x86_64.rpm

wget http://centos.ustc.edu.cn/centos/5/os/x86_64/CentOS/yum-3.2.22-40.el5.centos.noarch.rpm

wget http://centos.ustc.edu.cn/centos/5/os/x86_64/CentOS/yum-fastestmirror-1.1.16-21.el5.centos.noarch.rpm

rpm -ivh python-iniparse-0.2.3-6.el5.noarch.rpm

rpm -ivh yum-metadata-parser-1.1.2-4.el5.x86_64.rpm

rpm -ivh yum-3.2.22-40.el5.centos.noarch.rpm yum-fastestmirror-1.1.16-21.el5.centos.noarch.rpm

cd /etc/yum.repos.d/

wget http://mirrors.163.com/.help/CentOS5-Base-163.repo

yum clean all

yum makecache

rpm --import http://elrepo.org/RPM-GPG-KEY-elrepo.org

运行完成后,修改 /etc/yum.repos.d/CentOS6-Base-163.repo ,把其中的$releasever替换为你的OS的版本,例如5,好像Redhat不支持这个变量

http://mirrors.163.com/centos/5/os/x86_64/repodata/repomd.xml