centos7.2重新安装yum

本文档详细记录了在CentOS 7.2系统中遇到YUM无可用repo的问题及其解决过程,包括禁用fastestmirror插件,卸载并重新安装yum相关软件包,更新repo文件以及生成缓存。

摘要生成于 C知道 ,由 DeepSeek-R1 满血版支持, 前往体验 >

问题

[root@zf-test-web01-4 ~]# yum install rng-tools
Loaded plugins: fastestmirror
Loading mirror speeds from cached hostfile

There are no enabled repos.
 Run "yum repolist all" to see the repos you have.
 You can enable repos with yum-config-manager --enable <repo>

红色部分问题解决如下:

-bash-4.2# vi /etc/yum/pluginconf.d/fastestmirror.conf 


[main]
enabled=0
verbose=0
always_print_best_host = true
socket_timeout=3
#  Relative paths are relative to the cachedir (and so works for users as well
# as root).
hostfilepath=timedhosts.txt
maxhostfileage=10
maxthreads=15
#exclude=.gov, facebook


把enabled=1改为enabled=0

再次执行yum安装,仍报错

[root@zf-test-web01-4 ~]# yum install -y rng-tools
There are no enabled repos.
 Run "yum repolist all" to see the repos you have.
 You can enable repos with yum-config-manager --enable <repo>

也就是蓝色部分,解决办法:

1. 查看centos7.2系统本身所安装的那些yum 软件包

[root@zf-test-web01-4 ~]# rpm -qa|grep yum
yum-plugin-fastestmirror-1.1.31-34.el7.noarch
yum-metadata-parser-1.1.4-10.el7.x86_64
yum-3.4.3-132.el7.centos.0.1.noarch

[root@zf-test-web01-4 ~]# 


2. 卸载这些软件包

[root@zf-test-web01-4 ~]# rpm -e yum-plugin-fastestmirror-1.1.31-34.el7.noarch --nodeps
warn

评论 2
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

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

抵扣说明:

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

余额充值