CentOS 7 | 下载并安装yum

2020-08-24  本文已影响0人  Ada54

一、yum的下载并安装

step1:查看原有的yum

[root@localhost ~]# rpm -qa | grep yum

step2:删除yum下的所有组件

[root@localhost ~]# rpm -qa | grep yum | xargs rpm -e --nodeps 

step3:查询原有yum配置,并删除

[root@localhost ~]# whereis yum 
yum: /etc/yum
[root@localhost ~]# rm -fr /etc/yum

step4:去网站下载yum源

网站地址:http://mirrors.163.com/centos/7/os/x86_64/Packages/

需要下载的yum源链接如下:
(1)wget http://mirrors.163.com/centos/7/os/x86_64/Packages/yum-cron-3.4.3-167.el7.centos.noarch.rpm
(2)wget http://mirrors.163.com/centos/7/os/x86_64/Packages/yum-metadata-parser-1.1.4-10.el7.x86_64.rpm
(3)wget http://mirrors.163.com/centos/7/os/x86_64/Packages/yum-plugin-fastestmirror-1.1.31-53.el7.noarch.rpm
(4)wget http://mirrors.163.com/centos/7/os/x86_64/Packages/python-iniparse-0.4-9.el7.noarch.rpm

step5:安装yum

[root@localhost ~]# rpm -ivh --force --nodeps *.rpm

可查看一下是否安装yum

[root@localhost ~]# rpm -qa |grep yum

二、yum的配置

step6:进入 /etc/yum.repos.d文件夹下,下载CentOS7-Base-163.repo

[root@localhost ~]# cd /etc/yum.repos.d
[root@localhost ~]# wget http://mirrors.163.com/.help/CentOS7-Base-163.repo

step7:删除原来的配置文件,修改CentOS7-Base-163.repo配置文件名

[root@localhost ~]# rm -rf CentOS-Base.repo
[root@localhost ~]# mv CentOS7-Base-163.repo CentOS7-Base.repo
上一篇下一篇

猜你喜欢

热点阅读