保姆级教程-Linux:CentOS 7(alibaba cloud linux 2) 安装yum

一:删除原有的yum

1.查看已经安装的yum

[root@Server-i-09nwynqbbd ~]# rpm -qa |grep yum
yum-3.4.3-161.el7.centos.noarch
yum-utils-1.1.31-54.el7_8.noarch
yum-plugin-fastestmirror-1.1.31-50.el7.noarch
yum-metadata-parser-1.1.4-10.el7.x86_64


2.删除yum包

[root@Server-i-09nwynqbbd ~]# rpm -qa|grep yum|xargs rpm -e --nodeps


3.查看是否删除完毕(未找到yum包则删除完成)

[root@Server-i-09nwynqbbd ~]# rpm -qa |grep yum
[root@Server-i-09nwynqbbd ~]# 


二:查看Liunx系统版本

[root@Server-i-09nwynqbbd ~]# uname -an
Linux Server-i-09nwynqbbd 3.10.0-957.el7.x86_64 #1 SMP Thu Nov 8 23:39:32 UTC 2018 x86_64 x86_64 x86_64 GNU/Linux
[root@Server-i-09nwynqbbd ~]# cat /etc/redhat-release 
CentOS Linux release 7.6.1810 (Core)


三:下载yum有关的RPM包

[root@Server-i-09nwynqbbd ~]# wget http://mirrors.163.com/centos/7/os/x86_64/Packages/python-iniparse-0.4-9.el7.noarch.rpm
[root@Server-i-09nwynqbbd ~]# wget http://mirrors.163.com/centos/7/os/x86_64/Packages/yum-3.4.3-168.el7.centos.noarch.rpm
[root@Server-i-09nwynqbbd ~]# wget http://mirrors.163.com/centos/7/os/x86_64/Packages/yum-utils-1.1.31-54.el7_8.noarch.rpm
[root@Server-i-09nwynqbbd ~]# wget http://mirrors.163.com/centos/7/os/x86_64/Packages/yum-plugin-fastestmirror-1.1.31-54.el7_8.noarch.rpm
[root@Server-i-09nwynqbbd ~]# wget http://mirrors.163.com/centos/7/os/x86_64/Packages/yum-metadata-parser-1.1.4-10.el7.x86_64.rpm


四:安装下载好的yum有关的RPM包

[root@Server-i-09nwynqbbd ~]# rpm -ivh python-iniparse-0.4-9.el7.noarch.rpm --force --nodeps
[root@Server-i-09nwynqbbd ~]# rpm -ivh yum-* --force --nodeps
[root@Server-i-09nwynqbbd ~]# rpm -qa |grep yum
yum-3.4.3-168.el7.centos.noarch
yum-plugin-fastestmirror-1.1.31-54.el7_8.noarch
yum-utils-1.1.31-54.el7_8.noarch
yum-metadata-parser-1.1.4-10.el7.x86_64


五:查看是否安装完成

[root@Server-i-09nwynqbbd ~]# yum makecache
已加载插件:fastestmirror, product-id, search-disabled-repos, subscription-manager
 
This system is not registered with an entitlement server. You can use subscription-manager to register.
 
Loading mirror speeds from cached hostfile base                  | 3.6 kB  00:00:00     
docker-ce-stable                                                 | 3.5 kB  00:00:00     
epel                                                             | 4.7 kB  00:00:00     
extras                                                           | 2.9 kB  00:00:00     
updates                                                          | 2.9 kB  00:00:00     
(1/9): epel/x86_64/prestodelta                                   | 1.5 kB  00:00:00     
(2/9): docker-ce-stable/7/x86_64/filelists_db                    |  29 kB  00:00:00     
(3/9): docker-ce-stable/7/x86_64/other_db                        | 121 kB  00:00:00     
(4/9): extras/7/x86_64/filelists_db                              | 259 kB  00:00:00     
(5/9): extras/7/x86_64/other_db                                  | 145 kB  00:00:00     
(6/9): updates/7/x86_64/other_db                                 | 829 kB  00:00:00     
(7/9): epel/x86_64/other_db                                      | 3.4 MB  00:00:00     
(8/9): updates/7/x86_64/filelists_db                             | 6.6 MB  00:00:01     
(9/9): epel/x86_64/filelists_db                                  |  12 MB  00:00:02    

 
元数据缓存已建立

  • 0
    点赞
  • 1
    收藏
    觉得还不错? 一键收藏
  • 打赏
    打赏
  • 0
    评论

“相关推荐”对你有帮助么?

  • 非常没帮助
  • 没帮助
  • 一般
  • 有帮助
  • 非常有帮助
提交
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包

打赏作者

王大拿@

你的鼓励将是我创作的最大动力

¥1 ¥2 ¥4 ¥6 ¥10 ¥20
扫码支付:¥1
获取中
扫码支付

您的余额不足,请更换扫码支付或充值

打赏作者

实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

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

余额充值