開發環境——RHEL7更換yum源
阿新 • • 發佈:2018-05-12
RHEL7 更換yum源開發環境——RHEL7更換yum源
再次查詢yum是否刪除:
一、刪除RHN註冊和訂閱提示
查找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
二、yum安裝
1、yum卸載
查詢當前RHEL7.3的yum安裝包:rpm -qa |grep yum
強制刪除當前yum:sudo rpm -qa|grep yum|xargs rpm -e --nodeps
再次查詢yum是否刪除:
rpm -qa |grep yum
2、更新rpm
由於最新的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安裝包:
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
3、安裝yum
在http://mirrors.163.com/centos/7/os/x86_64/Packages/ 下載如下yum安裝包:
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
4、更新yum源為阿裏雲源
下載源倉庫文件:sudo wget -O /etc/yum.repos.d/CentOS-Base.repo http://mirrors.aliyun.com/repo/Centos-7.repo
將CentOS-Base.repo文件中的$releasever全部替換為版本號7
更新倉庫:
yum clean all
yum makecache
sudo yum?update
開發環境——RHEL7更換yum源