栏目分类:
子分类:
返回
名师互学网用户登录
快速导航关闭
当前搜索
当前分类
子分类
实用工具
热门搜索
名师互学网 > IT > 系统运维 > 运维 > Linux

完美解决CentOS8 yum安装AppStream报错

Linux 更新时间: 发布时间: IT归档 最新发布 模块sitemap 名妆网 法律咨询 聚返吧 英语巴士网 伯小乐 网商动力

完美解决CentOS8 yum安装AppStream报错

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'

转载请注明:文章转载自 www.mshxw.com
本文地址:https://www.mshxw.com/it/320558.html
我们一直用心在做
关于我们 文章归档 网站地图 联系我们

版权所有 (c)2021-2022 MSHXW.COM

ICP备案号:晋ICP备2021003244-6号