RedHat使用Centos的yum仓库
卸载红帽yum源
[root@zhouwanchun ~]# rpm -qa | grep yum
[root@zhouwanchun ~]# rpm -e $(rpm -qa | grep yum) --nodeps
warning: /etc/yum/pluginconf.d/langpacks.conf saved as /etc/yum/pluginconf.d/langpacks.conf.rpmsave
[root@zhouwanchun ~]# rpm -qa | grep yum
[root@zhouwanchun ~]# 删除所有的repo相关文件
[root@zhouwanchun ~]# rm -rf /etc/yum.conf
[root@zhouwanchun ~]# rm -rf /etc/yum.repos.d/
[root@zhouwanchun ~]# rm -rf /var/cache/yum 下载centos相关yum组件
[root@zhouwanchun ~]# cd /disk/
[root@zhouwanchun disk]# wget https://mirrors.aliyun.com/centos/7/os/x86_64/Packages/yum-3.4.3-158.el7.centos.noarch.rpm
[root@zhouwanchun disk]# wget https://mirrors.aliyun.com/centos/7/os/x86_64/Packages/yum-metadata-parser-1.1.4-10.el7.x86_64.rpm
[root@zhouwanchun disk]# wget https://mirrors.aliyun.com/centos/7/os/x86_64/Packages/yum-plugin-fastestmirror-1.1.31-45.el7.noarch.rpm
[root@zhouwanchun disk]# wget https://mirrors.aliyun.com/centos/7/os/x86_64/Packages/yum-updateonboot-1.1.31-45.el7.noarch.rpm
[root@zhouwanchun disk]# wget https://mirrors.aliyun.com/centos/7/os/x86_64/Packages/yum-utils-1.1.31-45.el7.noarch.rpm [root@zhouwanchun disk]# ls
yum-3.4.3-158.el7.centos.noarch.rpm
yum-metadata-parser-1.1.4-10.el7.x86_64.rpm
yum-plugin-fastestmirror-1.1.31-45.el7.noarch.rpm
yum-updateonboot-1.1.31-45.el7.noarch.rpm
yum-utils-1.1.31-45.el7.noarch.rpm 安装所有yum相关组件
[root@zhouwanchun disk]# pwd
/disk
[root@zhouwanchun disk]# ls
yum-3.4.3-158.el7.centos.noarch.rpm
yum-metadata-parser-1.1.4-10.el7.x86_64.rpm
yum-plugin-fastestmirror-1.1.31-45.el7.noarch.rpm
yum-updateonboot-1.1.31-45.el7.noarch.rpm
yum-utils-1.1.31-45.el7.noarch.rpm
[root@zhouwanchun disk]# rpm -ivh *.rpm --force --nodeps
Preparing... ################################# [100%]
Updating / installing...
1:yum-metadata-parser-1.1.4-10.el7 ################################# [ 20%]
2:yum-plugin-fastestmirror-1.1.31-4################################# [ 40%]
3:yum-3.4.3-158.el7.centos ################################# [ 60%]
4:yum-updateonboot-1.1.31-45.el7 ################################# [ 80%]
5:yum-utils-1.1.31-45.el7 ################################# [100%]
[root@zhouwanchun disk]#