Red Hat 7.5 Yum Replacement

This system is not registered with an entitlement server. You can use subscription-manager to register

Backgroud:

The little difference between CentOS series and Red Hat releases ... 

1:Test Environment

[root@xilong ~]# cat /etc/os-release
NAME="Red Hat Enterprise Linux Server"
VERSION="7.5 (Maipo)"
PRETTY_NAME="Red Hat Enterprise Linux Server 7.5 (Maipo)"
[root@xilong ~]# uname -r 3.10.0-862.el7.x86_64

 2:Delete Installed Yum Packages

[root@xilong ~]# rpm -qa |grep yum
yum-metadata-parser-1.1.4-10.el7.x86_64
yum-rhn-plugin-2.0.1-10.el7.noarch
yum-3.4.3-158.el7.noarch
yum-langpacks-0.4.2-7.el7.noarch
PackageKit-yum-1.1.5-1.el7.x86_64
yum-utils-1.1.31-45.el7.noarch

[root@xilong ~]# rpm -qa | grep yum | xargs rpm -e --nodeps
warning: /etc/yum/pluginconf.d/langpacks.conf saved as /etc/yum/pluginconf.d/langpacks.conf.rpmsave

[root@xilong ~]# rpm -qa |grep yum

 3:Download Related Yum Packages

 1 [root@xilong ~]# mkdir -p /server/packages 
 2 [root@xilong ~]# cd /server/packages/
 3 
 4 wget http://mirrors.163.com/centos/7.5.1804/os/x86_64/Packages/python-iniparse-0.4-9.el7.noarch.rpm
 5 wget http://mirrors.163.com/centos/7.5.1804/os/x86_64/Packages/yum-metadata-parser-1.1.4-10.el7.x86_64.rpm
 6 wget http://mirrors.163.com/centos/7.5.1804/os/x86_64/Packages/yum-3.4.3-158.el7.centos.noarch.rpm
 7 wget http://mirrors.163.com/centos/7.5.1804/os/x86_64/Packages/yum-plugin-fastestmirror-1.1.31-45.el7.noarch.rpm
 8 [root@xilong packages]# ls -l
 9 total 1368
10 -rw-r--r--. 1 root root 39800 Jul 4 2014 python-iniparse-0.4-9.el7.noarch.rpm
11 -rw-r--r--. 1 root root 1292216 Apr 25 19:52 yum-3.4.3-158.el7.centos.noarch.rpm
12 -rw-r--r--. 1 root root 28348 Jul 4 2014 yum-metadata-parser-1.1.4-10.el7.x86_64.rpm
13 -rw-r--r--. 1 root root 33660 Apr 25 19:52 yum-plugin-fastestmirror-1.1.31-45.el7.noarch.rpm
 
15 [root@xilong packages]# rpm -ivh yum*

17 [root@xilong packages]# rpm -ivh python-iniparse-0.4-9.el7.noarch.rpm

4:Download and Configure CentOS-Base

1 [root@xilong ~]# cd /etc/yum.repos.d/
2 [root@xilong yum.repos.d]# ls
   redhat.repo
4 [root@xilong yum.repos.d]# wget http://mirrors.163.com/.help/CentOS7-Base-163.repo

6 [root@xilong yum.repos.d]# sed 's#$releasever#7.5.1804#g' CentOS7-Base-163.repo
7 [root@xilong yum.repos.d]# sed 's#$releasever#7.5.1804#g' CentOS7-Base-163.repo -i
##[root@xilong yum.repos.d]# sed 's#163#aliyun#g' CentOS7-Base-163.repo -i

5:Work Finished

1 [root@xilong ~]# yum makecache

6:Update Yum

1 [root@xilong ~]# yum update -y

7: Add epel Source

1 [root@xilong yum.repos.d]# wget -O /etc/yum.repos.d/epel.repo http://mirrors.aliyun.com/repo/epel-7.repo

8:Download some Softwares You may Need for Monitoring

1 [root@xilong ~]# yum -y install glances htop
If you have any further questions, please feel free to send an E-mail to xilong_devops@163.com;
posted @ 2018-05-13 20:40 xilong_devops 阅读(...) 评论(...) 编辑 收藏