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

©️2020 CSDN 皮肤主题: 大白 设计师: CSDN官方博客 返回首页
实付0元
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、C币套餐、付费专栏及课程。

余额充值