解决CentOS8 yum安装AppStream报错

CentOS 8 yum安装软件时,提示无法从AppStream下载

1 [root@user ~]# yum -y install httpd mariadb-server mariadb php php-mysql
2 Repository AppStream is listed more than once in the configuration
3 Repository extras is listed more than once in the configuration
4 Repository PowerTools is listed more than once in the configuration
5 Repository centosplus is listed more than once in the configuration
6 Repository fasttrack is listed more than once in the configuration
7 CentOS-8 - AppStream                           0.0  B/s |   0  B     00:08    
8 Failed to download metadata for repo 'AppStream'
9 Error: Failed to download metadata for repo 'AppStream

 1.  先排除网络问题检查网通不通,然后确定DNS解析是否正确。

1 [root@user ~]# ping www.baidu.com
2 PING baidu.com (220.181.38.148) 56(84) bytes of data.

2.更换国内的yum源

  • 阿里yum源: centos镜像-centos下载地址-centos安装教程-阿里巴巴开源镜像站
  • 腾云yum源: CentOS
  • [root@user ~]# mv /etc/yum.repos.d/CentOS-Base.repo /etc/yum.repos.d/CentOS-Base.repo.backup.3
    [root@user ~]# 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

    4.建立新的缓存

  • [root@192 ~]# yum makecache

     

posted @ 2022-04-24 14:57  郑道杰  阅读(806)  评论(0编辑  收藏  举报