当前位置: > RedHat >

RHEL6 64bit下更改YUM配置。yum this system is not registered with rhn的解决办法

时间:2016-01-06 23:57来源:linux.it.net.cn 作者:it.net.cn
RHEL6 64bit下更改YUM配置。yum this system is not registered with rhn的解决办法 



卸载THEL6自导的YUM包

 

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


下载CentOS的YUM
wget http://centos.ustc.edu.cn/centos/6/os/x86_64/Packages/yum-plugin-fastestmirror-1.1.30-14.el6.noarch.rpm
wget http://centos.ustc.edu.cn/centos/6/os/x86_64/Packages/yum-metadata-parser-1.1.2-16.el6.x86_64.rpm
wget http://centos.ustc.edu.cn/centos/6/os/x86_64/Packages/yum-3.2.29-40.el6.centos.noarch.rpm
安装
rpm -ivh *.rpm
删除包
rm -rf *.rpm

更改yum源配置

cd /etc/yum.repos.d/

先备份

mv /etc/yum.repos.d/CentOS-Base.repo /etc/yum.repos.d/CentOS-Base.repo.backup

下面是修改RHEL的发行版本,否则YUM更新会报错

 

http://mirrors.163.com/centos/%24releasever/os/i386/repodata/repomd.xml: [Errno 14] HTTP Error 404 : http://mirrors.163.com/centos/%24releasever/os/i386/repodata/repomd.xml 
Trying other mirror.
Error: Cannot retrieve repository metadata (repomd.xml) for repository: base. Please verify its path and try again
下载Centos的release和indexhtml包,并重装。

 

rpm -e --nodeps redhat-release-server-6Server-6.0.0.37.el6.x86_64 redhat-indexhtml-6-1.el6.noarch

wget http://mirrors.163.com/centos/6/os/i386/Packages/centos-indexhtml-6-1.el6.centos.noarch.rpm
wget http://mirrors.163.com/centos/6/os/i386/Packages/centos-release-6-4.el6.centos.10.i686.rpm 


rpm -ivh *.rpm
rm -rf *.rpm
rm -rf CentOS-*.repo

下载正确的YUM源配置文件
#wget http://docs.linuxtone.org/soft/lemp/CentOS-Base.repo
wget http://mirrors.163.com/.help/CentOS6-Base-163.repo

最后重新加载YUM
yum clean all
yum makecache






(责任编辑:IT)
------分隔线----------------------------
栏目列表
推荐内容