1、查看yum配置文件:
1.1、查看yum配置文件:
[root@localhost ~]# ll /etc/yum.repos.d/
-rw-------. 1 root root 358 Sep 16 14:52 redhat.repo
2、检查yum是否安装,以及安装了哪些依赖并删除已安装的yum包:
2.1、检查已安装的yum包:
[root@localhost ~]# rpm -qa |grep yum
yum-3.4.3-168.el7.centos.noarch
yum-rhn-plugin-2.0.1-10.el7.noarch
yum-metadata-parser-1.1.4-10.el7.x86_64
yum-langpacks-0.4.2-7.el7.noarch
yum-utils-1.1.31-54.el7_8.noarch
2.2、删除已安装的yum包:
[root@localhost ~]# rpm -qa|grep yum|xargs rpm -e --nodeps
2.3、检查python-urlgrabber包:
[root@localhost ~]# rpm -qa|grep python-urlgrabber
python-urlgrabber-3.10-10.el7.noarch
2.4、删除python-urlgrabber包:
[root@localhost ~]# rpm -qa|grep python-urlgrabber-3.10-10.el7.noarch|xargs rpm -e --nodeps
3、下载yum依赖包及阿里云yum配置文件,修改yum配置文件并安装yum
3.1、下载yum依赖包
下载地址:centos-7-os-x86_64-Packages安装包下载_开源镜像站-阿里云
搜索如下rpm包,下载并上传到服务器:
PackageKit-yum-1.1.10-2.el7.centos.x86_64.rpm
python-urlgrabber-3.10-10.el7.noarch.rpm
yum-3.4.3-168.el7.centos.noarch.rpm
yum-langpacks-0.4.2-7.el7.noarch.rpm
yum-metadata-parser-1.1.4-10.el7.x86_64.rpm
yum-rhn-plugin-2.0.1-10.el7.noarch.rpm
yum-utils-1.1.31-54.el7_8.noarch.rpm
3.2、下载阿里云配置文件:
[root@localhost ~]# cd /etc/yum.repos.d/
[root@localhost yum.repo.d]# wget https://mirrors.aliyun.com/repo/Centos-7.repo?spm=a2c6h.25603864.0.0.1d2f5969mG9kn7
3.3、安装yum依赖的rpm包
[root@localhost home]# rpm -ivh python-urlgrabber-3.10-10.el7.noarch.rpm.
[root@localhost home]# rpm -ivh yum-* --force --nodeps
3.4、修改阿里云yum配置文件并刷新yum:文章来源:https://www.toymoban.com/news/detail-455230.html
[root@localhost yum.repo.d]# mv Centos-7.repo\?spm\=a2c6h.25603864.0.0.1d2f5969mG9kn7 Centos-Base.repo
[root@localhost yum.repo.d]# sed -i 's/$releasever/7/g' /etc/yum.repos.d/Centos-Base.repo
[root@localhost home]# yum clean all
[root@localhost home]# yum makecache
至此,yum重装完成文章来源地址https://www.toymoban.com/news/detail-455230.html
到了这里,关于RedHat7.9安装yum,使用阿里云yum源的文章就介绍完了。如果您还想了解更多内容,请在右上角搜索TOY模板网以前的文章或继续浏览下面的相关文章,希望大家以后多多支持TOY模板网!