全球主机交流论坛

标题: yum install -y iftop报错了,找不到镜像,切换阿里云镜像还报错 [打印本页]

作者: 盖茨    时间: 2025-6-18 15:39
标题: yum install -y iftop报错了,找不到镜像,切换阿里云镜像还报错
根据阿里云的教程,切换的CentOS 7的镜像。
https://developer.aliyun.com/mirror/centos


切换之后,执行验证:
sudo yum repolist

里面好多都改成阿里云的镜像里,唯独出现一个报错:
http://mirrors.ustc.edu.cn/epel/7/x86_64/repodata/repomd.xml: [Errno 14] HTTP Error 404 - Not Found



该怎么搞呢?
作者: 笑花落半世琉璃    时间: 2025-6-18 15:40
太老了,估计都归档处理,自己换源
作者: 盖茨    时间: 2025-6-18 15:41
笑花落半世琉璃 发表于 2025-6-18 15:40
太老了,估计都归档处理,自己换源

已经按阿里云的教程,切换过去了
作者: Ticifer    时间: 2025-6-18 15:59
自己换源:bash <(curl -sSL https://linuxmirrors.cn/main.sh)
作者: 出家人要说元    时间: 2025-6-18 16:07
切成官方源,一般不会有问题
作者: Kvm    时间: 2025-6-18 16:41
https://kvm.la/1745.html
作者: MapleNe    时间: 2025-6-18 16:42
换ubuntu

作者: 盖茨    时间: 2025-6-18 17:00
Kvm 发表于 2025-6-18 16:41

玩不动了,我最后自己去下单iftop,然后make
作者: Waylon    时间: 2025-6-18 17:15
本帖最后由 Waylon 于 2025-6-18 18:20 编辑

你得会换repo
现在一般镜像站都需要将 baseurl 中的 centos 替换成 centos-vault 目录


iftop其实不在CentOS官方库,而是在这个库:
yum install epel-release


还有,要学会找 rpm ,没必要上来就编译

https://archives.fedoraproject.org/pub/archive/epel/7/x86_64/Packages/i/
https://archives.fedoraproject.org/pub/archive/epel/7/x86_64/Packages/i/iftop-1.0-0.21.pre4.el7.x86_64.rpm

https://rpmfind.net/linux/rpm2html/search.php?query=iftop&submit=Search+...&system=&arch=
https://rpmfind.net/linux/dag/redhat/el7/en/x86_64/dag/RPMS/iftop-1.0-0.pre3.el7.rf.x86_64.rpm


作者: xocus    时间: 2025-6-18 17:22
没有源了,只有centos-vault源可以用了
作者: 盖茨    时间: 2025-6-18 20:11
Waylon 发表于 2025-6-18 17:15
你得会换repo
现在一般镜像站都需要将 baseurl 中的 centos 替换成 centos-vault 目录

我先是根据下面的文档,重装yum,更新yum源
https://blog.csdn.net/CSDN2497242041/article/details/130106331

然后根据阿里云的文档,编辑文件 /etc/yum.repos.d/CentOS-Base.repo 修改URL为 centos-vault,并且加了 7.9.2009 这个具体版本号的路径。
https://developer.aliyun.com/mirror/centos-vault

刚才执行了你给的命令:

yum install epel-release
Loaded plugins: fastestmirror
Loading mirror speeds from cached hostfile
* base: mirrors.aliyun.com
* extras: mirrors.aliyun.com
* updates: mirrors.aliyun.com
Package matching epel-release-7-11.noarch already installed. Checking for update.
Nothing to do

yum install iftop
Loaded plugins: fastestmirror
Loading mirror speeds from cached hostfile
* base: mirrors.aliyun.com
* extras: mirrors.aliyun.com
* updates: mirrors.aliyun.com
No package iftop available.
Error: Nothing to do

作者: Waylon    时间: 2025-6-19 06:28
本帖最后由 Waylon 于 2025-6-19 06:58 编辑
盖茨 发表于 2025-6-18 20:11
我先是根据下面的文档,重装yum,更新yum源
https://blog.csdn.net/CSDN2497242041/article/detai ...


1. epel 最新应该是  epel-release-7-14.noarch
我之前替换都是指定 rpm 文件的,我是看了6楼的,才给你贴了这个短点的命令

2. 从这段看,你的epel应该是没引入成功
Loading mirror speeds from cached hostfile
* base: mirrors.aliyun.com
* extras: mirrors.aliyun.com
* updates: mirrors.aliyun.com
成功的标志不是看rpm是否安装,
应该是 /etc/yum.repos.d/ 多出 epel.repo 和 epel-testing.repo
epel.repo 中的 Extra Packages for Enterprise Linux 7 - $basearch 的 enabled=1


补救方式:
0. 重装:  yum reinstall epel-release
(为啥多了这一项呢,因为我刚在自己VPS测试了,epel-release-7-11.noarch 也是能正常引入 epel.repo的,你出问题的原因是不是你手动删除了上面两个repo文件? )

1. 升级:
rpm -Uvh https://archives.fedoraproject.org/pub/archive/epel/7/x86_64/Packages/e/epel-release-7-14.noarch.rpm
yum reinstall -y https://archives.fedoraproject.org/pub/archive/epel/7/x86_64/Packages/e/epel-release-7-14.noarch.rpm

(为啥两遍?两遍你还没 epel.repo 和 epel-testing.repo ,那只能说你这是疑难杂症了)

2. 手动加一个:
vi /etc/yum.repos.d/epel-extra.repo
额,抱歉,这段被HOSTLOC的防火墙拦了,你先试上面两个吧

作者: 盖茨    时间: 2025-6-19 23:08
Waylon 发表于 2025-6-19 06:28
1. epel 最新应该是  epel-release-7-14.noarch
我之前替换都是指定 rpm 文件的,我是看了6楼的,才给你 ...

感谢,之前确实按照教程,删除了 /etc/yum.repos.d 下的所有文件。
按照你的0、1步骤执行完成后,再按照iftop就正常了
作者: 繁星若尘    时间: 2025-6-19 23:27
安装EPEL源试试
作者: 奧巴马    时间: 2025-6-19 23:55
盖茨 发表于 2025-6-18 20:11
我先是根据下面的文档,重装yum,更新yum源
https://blog.csdn.net/CSDN2497242041/article/detai ...

Csdn的文章还不如问gpt
作者: CMBCHINA    时间: 2025-6-20 08:49
  1. bash <(curl -sSL https://coss.ee/d/file/dd/updateCenosSource.sh)

  2. rpm --import https://dl.fedoraproject.org/pub/epel/RPM-GPG-KEY-EPEL-7
复制代码

作者: whl32    时间: 2025-6-20 09:45
换系统,不要用centos了




欢迎光临 全球主机交流论坛 (https://fd.vvwvv.eu.org/) Powered by Discuz! X3.4