redhat6.4配置centos6 yum替换
1、卸载掉
系统redhat自带的yum
rpm -qa |grep yum |xargs rpm -e --nodeps
2 下载相关的centos yum插件
主要有python-iniparse-0.3.1-2.1.el6.noarch.rpm
yum-3.2.29-40.el6.centos.noarch.rpm
yum-metadata-parser-1.1.2-16.el6.x86_64.rpm
yum-plugin-fastestmirror-1.1.30-14.el6.noarch.rpm
其中版本号和安装的系统版本,以及时32位系统和64位系统有关系
下载地址:http://mirrors.163.com/centos/
在linux可以使用命令直接下载到本地也可以
wget http://mirrors.163.com/centos/6/os/x86_64/Packages/python-iniparse-0.3.1-2.1.el6.noarch.rpm
wget http://mirrors.163.com/centos/6/os/x86_64/Packages/yum-metadata-parser-1.1.2-16.el6.x86_64.rpm
wget http://mirrors.163.com/centos/6/os/x86_64/Packages/yum-3.2.29-73.el6.centos.noarch.rpm
wget http://mirrors.163.com/centos/6/os/x86_64/Packages/yum-plugin-fastestmirror-1.1.30-37.el6.noarch.rpm
wget http://mirrors.163.com/centos/6/os/x86_64/Packages/python-urlgrabber-3.9.1-11.el6.noarch
注意:如果下载不了可能是小版本号有变化,可以直接下载后在上传到linux服务器
3 安装下载的yum包(如果没权限可以先修改权限 chmod 777 *)
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-40.el6.centos.noarch.rpm
python-urlgrabber-3.9.1-11.el6.noarch yum-plugin-fastestmirror-1.1.30-14.el6.noarch.rpm
最后三个需要一起安装,有相互依赖关系
4 下载配置文件CentOS6-Base-163.repo
wget http://mirrors.163.com/.help/CentOS6-Base-163.repo
5 修改CentOS6-Base-163.repo ,将其中的$releasever 更改为centos的版本,也就是6
vi CentOS6-Base-163.repo
:%s/$releasever/6
6 把配置文件放到指定目录 并且删除原来的配置文件
cd /etc/yum.repos.d
rm -fr *
mv /home/CentOS6-Base-163.repo ./
7 由于开始
将系统默认的yum功能删除,现在要回复yum:
rpm -ivh --nodeps http://soft.laozuo.org/iso/centos/x86_64/yum-plugin-fastestmirror-1.1.30-30.el6.noarch.rpm
rpm -ivh --nodeps http://soft.laozuo.org/iso/centos/x86_64/yum-metadata-parser-1.1.2-16.el6.x86_64.rpm
rpm -ivh --nodeps http://soft.laozuo.org/iso/centos/x86_64/yum-3.2.29-69.el6.centos.noarch.rpm
rpm -ivh --nodeps http://soft.laozuo.org/iso/centos/x86_64/yum-metadata-parser-1.1.2-16.el6.x86_64.rpm
rpm -ivh --nodeps http://soft.laozuo.org/iso/centos/x86_64/yum-3.2.29-69.el6.centos.noarch.rpm
8 清除缓存 yum clean all
9 配置获取yum列表
yum makecache