1. 程式人生 > >解決redhat6.4的yum未註冊無法使用的問題

解決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