修改redhat7.5的yum源为阿里云的yum源

1,强制卸载所有包

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

2,查看是否卸载完全

rpm -qa|grep yum

3,下载相关的rpm插件,

mkdir  software

cd software

wget https://mirrors.aliyun.com/centos/7/os/x86_64/Packages/python-chardet-2.2.1-3.el7.noarch.rpm

wget https://mirrors.aliyun.com/centos/7/os/x86_64/Packages/python-kitchen-1.1.1-5.el7.noarch.rpm

wget https://mirrors.aliyun.com/centos/7/os/x86_64/Packages/python-urlgrabber-3.10-10.el7.noarch.rpm

wget https://mirrors.aliyun.com/centos/7/os/x86_64/Packages/rpm-4.11.3-43.el7.x86_64.rpm

wget https://mirrors.aliyun.com/centos/7/os/x86_64/Packages/rpm-build-libs-4.11.3-43.el7.x86_64.rpm

wget https://mirrors.aliyun.com/centos/7/os/x86_64/Packages/rpm-python-4.11.3-43.el7.x86_64.rpm

wget https://mirrors.aliyun.com/centos/7/os/x86_64/Packages/wget-1.14-18.el7_6.1.x86_64.rpm

wget https://mirrors.aliyun.com/centos/7/os/x86_64/Packages/yum-3.4.3-167.el7.centos.noarch.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-plugin-filter-data-1.1.31-53.el7.noarch.rpm

wget https://mirrors.aliyun.com/centos/7/os/x86_64/Packages/yum-updateonboot-1.1.31-53.el7.noarch.rpm

wget https://mirrors.aliyun.com/centos/7/os/x86_64/Packages/yum-utils-1.1.31-53.el7.noarch.rpm

4,安装所有插件

rpm -ivh *.rpm --force --nodeps

5,修改yum配置

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

6,修改CentOS-Base.repo文件

vi /etc/yum.repos.d/CentOS-Base.repo 

$releasever全局替换成7执行

:%s/$releasever/7/g 

mirrors.aliyuncs.com 全部改成 mirrors.aliyun.com 不然后面会报错,mirrors.aliyuncs.com这个域名好像有问题,具体情况不明:

:s/aliyuncs/aliyun/g

:wq  保存退出

7,#yum clean all

#yum makecache     生成元数据缓存

测试

yum -y install tree  用tree查看文件夹结构

 

 

 

 

 

  • 1
    点赞
  • 3
    收藏
    觉得还不错? 一键收藏
  • 0
    评论
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值