解决redhat6.4的yum未注册无法使用的问题

1.卸载redhat的yum,用指令rpm -qa|grep python-in|xargs rpm -e --nodeps

2.下载centos的yum,一共四个rpm。python-iniparse-0.3.1-2.1.el6.noarch.rpm。yum-3.2.29-73.el6.centos.noarch.rpm。yum-metadata-parser-1.1.2-16.el6.x86_64.rpm。yum-plugin-fastestmirror-1.1.31-505.fc22.noarch.rpm。

可以在这里面下载:http://rpmfind.net/linux/rpm2html/search.php?query=yum&submit=Search+...&system=&arch=

3.四个包一起安装rpm -ivh yum-* python-urlgrabber-3.9.1-11.el6.noarch.rpm

4.新增/etc/yum.repos.d/CentOS-Base.repo,内容如下

[base]
name=CentOS-$releasever - Base - 163.com
baseurl=http://mirrors.163.com/centos/6/os/$basearch/
#mirrorlist=http://mirrorlist.centos.org/?release=$releasever&arch=$basearch&repo=os
gpgcheck=1
gpgkey=http://mirror.centos.org/centos/RPM-GPG-KEY-CentOS-6


#released updates 
[updates]
name=CentOS-$releasever - Updates - 163.com
baseurl=http://mirrors.163.com/centos/6/updates/$basearch/
#mirrorlist=http://mirrorlist.centos.org/?release=$releasever&arch=$basearch&repo=updates
gpgcheck=1
gpgkey=http://mirror.centos.org/centos/RPM-GPG-KEY-CentOS-6


#additional packages that may be useful
[extras]
name=CentOS-$releasever - Extras - 163.com
baseurl=http://mirrors.163.com/centos/6/extras/$basearch/
#mirrorlist=http://mirrorlist.centos.org/?release=$releasever&arch=$basearch&repo=extras
gpgcheck=1
gpgkey=http://mirror.centos.org/centos/RPM-GPG-KEY-CentOS-6


#additional packages that extend functionality of existing packages
[centosplus]
name=CentOS-$releasever - Plus - 163.com
baseurl=http://mirrors.163.com/centos/6/centosplus/$basearch/
#mirrorlist=http://mirrorlist.centos.org/?release=$releasever&arch=$basearch&repo=centosplus
gpgcheck=1
enabled=0
gpgkey=http://mirror.centos.org/centos/RPM-GPG-KEY-CentOS-6


#contrib - packages by Centos Users
[contrib]
name=CentOS-$releasever - Contrib - 163.com
baseurl=http://mirrors.163.com/centos/6/contrib/$basearch/
#mirrorlist=http://mirrorlist.centos.org/?release=$releasever&arch=$basearch&repo=contrib
gpgcheck=1
enabled=0
gpgkey=http://mirror.centos.org/centos/RPM-GPG-KEY-CentOS-6

5.yum clean all

6.yum makecache

7.yum update





你可能感兴趣的:(linux,yum)