查找subscription-manager相關組件:rpm -qa|grep subscription-manager
刪除subscription-manager相關組件:sudo yum remove subscription-manager
查找rhn相關組件:rpm -qa|grep rhn
刪除rhn相關組件:sudo yum remove rhn-check
node
查詢當前RHEL7.3的yum安裝包:rpm -qa |grep yum
強制刪除當前yum:sudo rpm -qa|grep yum|xargs rpm -e --nodeps
再次查詢yum是否刪除:rpm -qa |grep yum
python
因爲最新的yum安裝包依賴rpm-4.11.3-32.el7.x86_64.rpm,因此必須升級rpm到rpm-4.11.3-32.el7.x86_64.rpm
在http://mirrors.163.com/centos/7/os/x86_64/Packages/ 下載以下rpm安裝包:centos
rpm-4.11.3-32.el7.x86_64.rpm rpm-build-4.11.3-32.el7.x86_64.rpm rpm-build-libs-4.11.3-32.el7.x86_64.rpm rpm-libs-4.11.3-32.el7.x86_64.rpm rpm-devel-4.11.3-32.el7.x86_64.rpm
強制安裝全部的rpm安裝包:sudo rpm -ivh rpm-* --force
ide
在http://mirrors.163.com/centos/7/os/x86_64/Packages/ 下載以下yum安裝包:ui
yum-3.4.3-158.el7.centos.noarch.rpm yum-utils-1.1.31-45.el7.noarch.rpm yum-metadata-parser-1.1.4-10.el7.x86_64.rpm python-urlgrabber-3.10-8.el7.noarch.rpm yum-updateonboot-1.1.31-45.el7.noarch.rpm yum-plugin-fastestmirror-1.1.31-45.el7.noarch.rpm
安裝:阿里雲
sudo rpm -ivh python-urlgrabber-3.10-8.el7.noarch.rpm sudo rpm -ivh yum-*
安裝成功,查詢yum版本yum --version
url
下載源倉庫文件:sudo wget -O /etc/yum.repos.d/CentOS-Base.repo http://mirrors.aliyun.com/repo/Centos-7.repo
將CentOS-Base.repo文件中的$releasever所有替換爲版本號7
更新倉庫:code
yum clean all yum makecache sudo yum update