Red hat6.3使用Centos6的yum
从某个意义上来说,RedHat其实就是收费版的Centos,所以当你yum或者更新的时候,就会提示你需要注册,而注册就需要银子,这里我们可以自己动手换成Centos。
1:删除Red hat源
rpm -aq|grep yum|xargs rpm -e –nodeps
2:下载Centos源安装文件,这里用163的源,下载地址:http://mirrors.163.com/centos/6.8/os/x86_64/Packages/ 注意:163一般只保留最后一个版本,所以6.8以前有可能都没有,我这里是64位系统,所以选择x86_6x目录
wget http://mirrors.163.com/centos/6.8/os/x86_64/Packages/yum-3.2.29-73.el6.centos.noarch.rpm wget http://mirrors.163.com/centos/6.8/os/x86_64/Packages/yum-metadata-parser-1.1.2-16.el6.x86_64.rpm wget http://mirrors.163.com/centos/6.8/os/x86_64/Packages/yum-plugin-fastestmirror-1.1.30-37.el6.noarch.rpm wget http://mirrors.163.com/centos/6.8/os/x86_64/Packages/python-iniparse-0.3.1-2.1.el6.noarch.rpm3:安装新的yum
rpm -ivh python-iniparse-0.3.1-2.1.el6.noarch.rpm rpm -ivh yum-metadata-parser-1.1.2-16.el6.x86_64.rpm rpm -ivh yum-3.2.29-73.el6.centos.noarch.rpm yum-plugin-fastestmirror-1.1.30-37.el6.noarch.rpm最后两个相互依赖,一起安装!
我这里最后两个安装失败,提示:
原因:缺少python,继续安装python组建,下载python组建,还是在刚才的目录
wget http://mirrors.163.com/centos/6.8/os/x86_64/Packages/python-urlgrabber-3.9.1-11.el6.noarch.rpm wget http://mirrors.163.com/centos/6.8/os/x86_64/Packages/python-2.6.6-64.el6.x86_64.rpm wget http://mirrors.163.com/centos/6.8/os/x86_64/Packages/python-libs-2.6.6-64.el6.x86_64.rpm
安装
rpm -ivhpython-libs-2.6.6-64.el6.x86_64.rpm python-2.6.6-64.el6.x86_64.rpm python-urlgrabber-3.9.1-11.el6.noarch.rpm我靠竟然报错
强制安装再来一次:--nodeps --force
rpm -ivhpython-libs-2.6.6-64.el6.x86_64.rpm python-2.6.6-64.el6.x86_64.rpm python-urlgrabber-3.9.1-11.el6.noarch.rpm --nodeps --force太贱了,终于成功了。
继续最后两个:
rpm -ivh yum-3.2.29-73.el6.centos.noarch.rpm yum-plugin-fastestmirror-1.1.30-37.el6.noarch.rpm
成功安装!
4:下载163的源:http://mirrors.163.com/.help/centos.html,Red hat本身的yum建议先备份吧。/etc/yum.repos.d文件夹下。
5:更新yum缓存
yum clean all
成功
再运行:
yum makecache
靠竟然失败,什么原因?看失败提示。网易yum文件里的$releasever和$basearch这两个变量没有环境变量,咋办?手动加下吧。我们是用Centos6,所以$releasever 替换成6,$basearch替换成x86_64,如果是32位替换成i386。
再试:
大功告成!