redhat默认自带的yum源需要注册付费才能更新,而centos的yum源是免费的,为了使用方便我们把red hat的yum源改成centos的网易的yum源。
1、卸载red hat的yum
rpm -qa|grep yum|xargs rpm -e --nodeps
2、下载centos的yum
64位 wget http://mirrors.163.com/centos/6/os/x86_64/Packages/yum-3.2.29-81.el6.centos.noarch.rpm wget http://mirrors.163.com/centos/6/os/x86_64/Packages/yum-plugin-fastestmirror-1.1.30-40.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
32位 wget http://mirrors.163.com/centos/6/os/i386/Packages/yum-3.2.29-81.el6.centos.noarch.rpm wget http://mirrors.163.com/centos/6/os/i386/Packages/yum-plugin-fastestmirror-1.1.30-40.el6.noarch.rpm wget http://mirrors.163.com/centos/6/os/i386/Packages/yum-Metadata-parser-1.1.2-16.el6.i686.rpm
3、安装centos yum
64位 rpm -ivh yum-Metadata-parser-1.1.2-16.el6.x86_64.rpm yum-3.2.29-81.el6.centos.noarch.rpm yum-plugin-fastestmirror-1.1.30-40.el6.noarch.rpm --force --nodeps 32位 rpm -ivh yum-Metadata-parser-1.1.2-16.el6.i686.rpm yum-3.2.29-81.el6.centos.noarch.rpm yum-plugin-fastestmirror-1.1.30-40.el6.noarch.rpm --force --nodeps
cd /etc/yum.repos.d/ #进入到yum配置文件目录 wget http://mirrors.163.com/.help/CentOS6-Base-163.repo #下载CentOS配置文件 vi CentOS6-Base-163.repo #编辑配置文件 :%s/$releasever/6/g #把$releasever替换成现有系统的版本号(6) yum clean all #清除yum缓存 yum makecache #更新yum缓存 yum update #更新系统
5、验证 原文链接:https://www.f2er.com/bash/391757.html