解决Centos8 yum源报错

1Centos8 yum安装软件时无法下载

[root@localhost ~]# yum -y install wget
CentOS-8 - AppStream                           0.0  B/s |   0  B     00:08    
Failed to download metadata for repo 'AppStream'
Error: Failed to download metadata for repo 'AppStream'

2 检测网络

复制代码
[root@localhost ~]# ping baidu.com
PING baidu.com (220.181.38.251) 56(84) bytes of data.
64 bytes from 220.181.38.251 (220.181.38.251): icmp_seq=1 ttl=128 time=40.1 ms
64 bytes from 220.181.38.251 (220.181.38.251): icmp_seq=2 ttl=128 time=38.4 ms
64 bytes from 220.181.38.251 (220.181.38.251): icmp_seq=3 ttl=128 time=38.1 ms
64 bytes from 220.181.38.251 (220.181.38.251): icmp_seq=4 ttl=128 time=38.2 ms
64 bytes from 220.181.38.251 (220.181.38.251): icmp_seq=5 ttl=128 time=37.10 ms
64 bytes from 220.181.38.251 (220.181.38.251): icmp_seq=6 ttl=128 time=37.9 ms
64 bytes from 220.181.38.251 (220.181.38.251): icmp_seq=7 ttl=128 time=38.1 ms
复制代码

3 删除大多数配置

[root@localhost ~]# cd /etc/yum.repos.d/
[root@localhost yum.repos.d]# rm *.repos

4 更换国内源

阿里源:https://developer.aliyun.com/mirror/centos

腾讯源:https://mirrors.tencent.com/help/centos.html

5 清理 yum缓存

yum clean all

6 建立新的缓存

yum makecache

 

posted @   #44  阅读(232)  评论(0编辑  收藏  举报
相关博文:
阅读排行:
· 阿里最新开源QwQ-32B,效果媲美deepseek-r1满血版,部署成本又又又降低了!
· AI编程工具终极对决:字节Trae VS Cursor,谁才是开发者新宠?
· 开源Multi-agent AI智能体框架aevatar.ai,欢迎大家贡献代码
· Manus重磅发布:全球首款通用AI代理技术深度解析与实战指南
· 被坑几百块钱后,我竟然真的恢复了删除的微信聊天记录!
点击右上角即可分享
微信分享提示