两个帖子正确替换centos的阿里yum源

Redhad 7改用CentOS7 yum源

 

[转]redhat7(centos7) not registered to Red Hat Subscription Management

 

rpm -qa|grep yum|xargs rpm -e --nodeps

rpm -qa |grep yum

rpm -qa|grep python-urlgrabber|xargs rpm -e --nodeps

 

https://mirrors.aliyun.com/centos/7/os/x86_64/Packages/ 

两个帖子正确替换centos的阿里yum源_第1张图片

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-154.el7.centos.noarch.rpm 
wget https://mirrors.aliyun.com/centos/7/os/x86_64/Packages/yum-plugin-fastestmirror-1.1.31-42.el7.noarch.rpm 
wget https://mirrors.aliyun.com/centos/7/os/x86_64/Packages/yum-utils-1.1.31-42.el7.noarch.rpm
wget https://mirrors.aliyun.com/centos/7/os/x86_64/Packages/python-urlgrabber-3.10-8.el7.noarch.rpm
wget https://mirrors.aliyun.com/centos/7/os/x86_64/Packages/yum-langpacks-0.4.2-7.el7.noarch.rpm
wget https://mirrors.aliyun.com/centos/7/os/x86_64/Packages/yum-rhn-plugin-2.0.1-9.el7.noarch.rpm
wget https://mirrors.aliyun.com/centos/7/os/x86_64/Packages/rpm-4.11.3-25.el7.x86_64.rpm
版本可能更新,直接搜包名称下载

 

rpm -ivh python-urlgrabber-3.10-8.el7.noarch.rpm

rpm -Uvh rpm-4.11.3-25.el7.x86_64.rpm --nodeps

rpm -ivh yum-*

wget -O /etc/yum.repos.d/CentOS-Base.repo http://mirrors.aliyun.com/repo/Centos-7.repo

cp到/etc/yum.repos.d/

打开Centos-7.repo

在vim中替换掉系统版本号

vim命令:

:n,$s/$serverversion/7/g  替换$serverversion为7

yum makecache

 

end

你可能感兴趣的:(linux)