CentOS 8 yum安装软件时,提示无法从AppStream下载
[root@192 ~]# yum -y install httpd mariadb-server mariadb php php-mysql
Repository AppStream is listed more than once in the configuration
Repository extras is listed more than once in the configuration
Repository PowerTools is listed more than once in the configuration
Repository centosplus is listed more than once in the configuration
Repository fasttrack is listed more than once in the configuration
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'
1. 先排除网络问题检查网通不通,然后确定DNS解析是否正确。
[root@192 ~]# ping www.baidu.com
PING baidu.com (220.181.38.148) 56(84) bytes of data.
64 bytes from 220.181.38.148 (220.181.38.148): icmp_seq=1 ttl=128 time=12.3 ms
64 bytes from 220.181.38.148 (220.181.38.148): icmp_seq=2 ttl=128 time=12.2 ms
64 bytes from 220.181.38.148 (220.181.38.148): icmp_seq=3 ttl=128 time=12.7 ms
64 bytes from 220.181.38.148 (220.181.38.148): icmp_seq=4 ttl=128 time=13.5 ms
64 bytes from 220.181.38.148 (220.181.38.148): icmp_seq=5 ttl=128 time=12.1 ms
64 bytes from 220.181.38.148 (220.181.38.148): icmp_seq=6 ttl=128 time=12.1 ms
64 bytes from 220.181.38.148 (220.181.38.148): icmp_seq=7 ttl=128 time=13.7 ms
2.更换国内的yum源
- 阿里yum源: centos镜像-centos下载地址-centos安装教程-阿里巴巴开源镜像站
- 腾云yum源: CentOS
-
[root@192 ~]# mv /etc/yum.repos.d/CentOS-Base.repo /etc/yum.repos.d/CentOS-Base.repo.backup.3 [root@192 ~]# wget -O /etc/yum.repos.d/CentOS-Base.repo http://mirrors.cloud.tencent.com/repo/centos8_base.repo
3.清理之前的yum缓存。
-
[root@192 ~]# yum clean all Repository AppStream is listed more than once in the configuration Repository extras is listed more than once in the configuration Repository PowerTools is listed more than once in the configuration Repository centosplus is listed more than once in the configuration Repository fasttrack is listed more than once in the configuration 18 files removed
4.建立新的缓存。
-
[root@192 ~]# yum makecache Repository AppStream is listed more than once in the configuration Repository extras is listed more than once in the configuration Repository PowerTools is listed more than once in the configuration Repository centosplus is listed more than once in the configuration Repository fasttrack is listed more than once in the configuration CentOS-8 - AppStream 0.0 B/s | 0 B 00:04 Failed to download metadata for repo 'AppStream' Error: Failed to download metadata for repo 'AppStream'