因工作需要现在用的系统换成Redhat7.5了,记录下Redhat7.5更换成centos的yum源过程
1.首先删除redhat原有的yum ,因为redhat 原本的yum 没有注册为redhat用户是用不了的。
rpm -aq|grep yum|xargs rpm -e --nodeps
2.下载aliyun的yum 安装包
wget mirrors.aliyun.com/centos/7.5.1804/os/x86_64/Packages/python-iniparse-0.4-9.el7.noarch.rpm
wget mirrors.aliyun.com/centos/7.5.1804/os/x86_64/Packages/python-urlgrabber-3.10-8.el7.noarch.rpm
wget mirrors.aliyun.com/centos/7.5.1804/os/x86_64/Packages/yum-3.4.3-158.el7.centos.noarch.rpm
wget mirrors.aliyun.com/centos/7.5.1804/os/x86_64/Packages/yum-metadata-parser-1.1.4-10.el7.x86_64.rpm
wget mirrors.aliyun.com/centos/7.5.1804/os/x86_64/Packages/yum-plugin-fastestmirror-1.1.31-45.el7.noarch.rpm
3.进行安装yum
rpm -ivh python-iniparse-0.4-9.el7.noarch.rpm
rpm -ivh python-urlgrabber-3.10-8.el7.noarch.rpm
rpm -ivh yum-metadata-parser-1.1.4-10.el7.x86_64.rpm
rpm -ivh yum-3.4.3-158.el7.centos.noarch.rpm yum-plugin-fastestmirror-1.1.31-45.el7.noarch.rpm
4.创建repo文件
vi rhel-debuginfo.repo
在文件中写入

[base]
name=CentOS-$releasever - Base
baseurl=http://mirrors.aliyun.com/centos/7.5.1804/os/$basearch/
gpgcheck=1
gpgkey=http://mirrors.aliyun.com/centos/7.5.1804/os/x86_64/RPM-GPG-KEY-CentOS-7


#released updates
[updates]
name=CentOS-$releasever - Updates
baseurl=http://mirrors.aliyun.com/centos/7.5.1804/updates/$basearch/
gpgcheck=1
gpgkey=http://mirrors.aliyun.com/centos/7.5.1804/os/x86_64/RPM-GPG-KEY-CentOS-7


[extras]
name=CentOS-$releasever - Extras
baseurl=http://mirrors.aliyun.com/centos/7.5.1804/extras//$basearch/
gpgcheck=1
gpgkey=http://mirrors.aliyun.com/centos/7.5.1804/os/x86_64/RPM-GPG-KEY-CentOS-7

[centosplus]
name=CentOS-$releasever - Plus
baseurl=http://mirrors.aliyun.com/centos/7.5.1804/centosplus//$basearch/
gpgcheck=1
enabled=0

5.清除缓存并更新
yum clean all
yum update
6.安装epel
yum install epel-release