最近弄了一臺服務器,安裝的是RedHat5.5 32位的系統。可是在使用yum的過程當中報錯:node
[root@banping mysql-5.5.10]# yum install libaio-devel
Loaded plugins: rhnplugin, security
This system is not registered with RHN.
RHN support will be disabled.
Setting up Install Process
No package libaio-devel available.
Nothing to domysql
意思是這套RH沒有在官網上註冊,不能下載RH的軟件包。後來我把yum替換成了CentOS的版本,過程以下:
首先看看有哪些yum包,而後卸載掉:linux
[root@banping mysql-5.5.10]# rpm -qa|grep yum
yum-rhn-plugin-0.5.4-13.el5
yum-3.2.22-20.el5
yum-metadata-parser-1.1.2-3.el5
yum-security-1.1.16-13.el5
yum-updatesd-0.9-2.el5sql
卸載要使用nodeps參數,不然因爲依賴關係是沒法卸載成功的:centos
rpm -e –nodeps yum-rhn-plugin-0.5.4-13.el5
……緩存
而後能夠從163的鏡像下載CentOS的yum包:服務器
[root@banping centos]# wget http://mirrors.163.com/centos/5/os/x86_64/CentOS/yum-3.2.22-39.el5.centos.noarch.rpm
[root@banping centos]# wget http://mirrors.163.com/centos/5/os/x86_64/CentOS/yum-fastestmirror-1.1.16-21.el5.centos.noarch.rpm
[root@banping centos]# wget http://mirrors.163.com/centos/5/os/x86_64/CentOS/yum-metadata-parser-1.1.2-3.el5.centos.x86_64.rpmide
安裝新下載的包:資源
[root@banping centos]# rpm -ivh yum-*get
找一個CentOS的包資源配置庫,名爲CentOS-Base.repo,放到/etc/yum.repos.d/路徑:
wget http://www.linuxidc.com/files/2011/05/06/CentOS-Base.repo
生成緩存文件到/var/cache/yum路徑:
[root@banping yum.repos.d]# yum makecache
這樣就能夠使用CentOS的yum了。