redhat默认不支持第三方的yum源,要求有rhn账号,下面把rhel6改为centos源
删除原有的yum相关的rpm包
rpm -qa|
grep
yum
rpm -e --nodeps yum-rhn-plugin
rpm -e --nodeps yum-metadata-parser
rpm -e --nodeps yum-utils
rpm -e --nodeps yum-plugin-security
rpm -e --nodeps rhn-check
下载安装包并安装
mkdir -p /server/tools cd /server/tools/ 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-3.2.29-69.el6.centos.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-plugin-fastestmirror-1.1.30-30.el6.noarch.rpm rpm -ivh python-iniparse-0.3.1-2.1.el6.noarch.rpm rpm -ivh yum-3.2.29-69.el6.centos.noarch.rpm yum-metadata-parser-1.1.2-16.el6.x86_64.rpm yum-plugin-fastestmirror-1.1.30-30.el6.noarch.rpm
重命名原有自带的repo文件,并下载163的repo文件
cd /etc/yum.repos.d/
mv rhel-source.repo rhel-source.repo.bak wget http://mirrors.163.com/.help/CentOS6-Base-163.repo rpm --import http://mirrors.163.com/centos/6/os/x86_64/RPM-GPG-KEY-CentOS-6 sed -i 's#$releasever#6#g' CentOS6-Base-163.repo 清空缓存,并重新生成 yum clean all yum makecahe 如果配置阿里的yum源,则可以加入如下命令 wget -O /etc/yum.repos.d/CentOS-Base.repo 至此rhel6配置centos源配置完成
转载自:http://francis198.blog.51cto.com/720670/1783809