red hat的yum源修改为centos的yum源

前端之家收集整理的这篇文章主要介绍了red hat的yum源修改为centos的yum源前端之家小编觉得挺不错的,现在分享给大家,也给大家做个参考。

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


4、配置yum源
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

猜你在找的Bash相关文章