标签:term test 依赖关系 arch repos follow com oss 删除
1.下载所需要的rpm安装包(可能有些包之间的小版本好不一样,可以直接去阿里云上下载)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/yum-utils-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 python-urlgrabber-3.10-9.el7.noarch.rpm
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
标签:term test 依赖关系 arch repos follow com oss 删除
原文地址:http://blog.51cto.com/byu46123/2331387