Redhat7.6 yum源替換阿裏yum源
https://mirrors.aliyun.com/centos/7/os/x86_64/Packages/
wget https://mirrors.aliyun.com/centos/7/os/x86_64/Packages/yum-metadata-parser-1.1.4-10.el7.x86_64.rpm
wget https://mirrors.aliyun.com/centos/7/os/x86_64/Packages/yum-3.4.3-161.el7.centos.noarch.rpm
wget https://mirrors.aliyun.com/centos/7/os/x86_64/Packages/yum-plugin-fastestmirror-1.1.31-50.el7.noarch.rpm
wget https://mirrors.aliyun.com/centos/7/os/x86_64/Packages/python-urlgrabber-3.10-9.el7.noarch.rpm
2.查詢yum包和刪除yum現有rpm包,刪完以後再查看一下,是否刪除幹凈,刪除完成後安裝剛剛下載好的rpm包,yum包安裝時必須取消依賴關系和強制安裝
rpm -qa | grep yum
rpm -qa | grep yum | xargs rpm -e --nodeps
rpm -ivh yum-* --force --nodeps
3.將現有的redhat .repo的包重命名,再下載阿裏雲的.repo到/etc/yum.repos.d目錄下
wget -O /etc/yum.repos.d/CentOS-Base.repo http://mirrors.aliyun.com/repo/Centos-7.repo
4.修改剛下載的.repo文件,將裏面所有$releasever替換為7
vim CentOS-Base.repo
:%s/$releaserver/7/g --/g 表示一行當中如果出現了多次,每一次都替換
5.運行以下命令
yum clean all
yum makecache
yum update
Redhat7.6 yum源替換阿裏yum源