当前位置:首页 > 网站制作 > 正文内容

完美解决CentOS8 yum安装AppStream报错,更新yum后无法makecache的问题

admin4年前 (2022-08-15)网站制作903

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

[root@C8-3 ~]# 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'

  

更换国内yum源

# mv /etc/yum.repos.d/CentOS-Base.repo /etc/yum.repos.d/CentOS-Base.repo.backup.3
# wget -O /etc/yum.repos.d/CentOS-Base.repo http://mirrors.cloud.tencent.com/repo/centos8_base.repo

 

清理之前的yum缓存

# yum clean all

  

建立新的缓存

# yum makecache

  

解决makecahe报错

centos8会出现以下报错

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'

  

解决办法

  • 将CentOS-AppStream.repo文件中的链接更新

# vim /etc/yum.repos.d/CentOS-AppStream.repo
  • 注释掉原有内容,并插入新内容

#这一段注释掉
#[AppStream]
#name=CentOS-$releasever - AppStream
#mirrorlist=http://mirrorlist.centos.org/?release=$releasever&arch=$basearch&repo=AppStream&infra=$infra
#baseurl=http://mirror.centos.org/$contentdir/$releasever/AppStream/$basearch/os/
#mirrorlist=http://mirror.centos.org/$contentdir/$releasever/AppStream/$basearch/os/
#gpgcheck=1
#enabled=1
#pgkey=file:///etc/pki/rpm-gpg/RPM-GPG-KEY-centosofficial#改为下面这段
[AppStream]
name=Qcloud centos AppStream - $basearch
baseurl=http://mirrors.cloud.tencent.com/centos/$releasever/AppStream/$basearch/os/
enabled=0
gpgcheck=1
gpgkey=http://mirrors.cloud.tencent.com/centos/RPM-GPG-KEY-CentOS-Official
  • 重新运行 # yum makecache

# yum makecache


扫描二维码推送至手机访问。

版权声明:本文由博赚恋吧资源站发布,如需转载请注明出处。

本文链接:https://432l.com/post/9746.html

分享给朋友:

相关文章

Web2.0设计生成工具

Web2.0设计生成工具Stripe Designer  Web 2.0 Logo Creator...

Getjar:手机软件下载服务网站

你可以按照以下手机操作平台查找软件: 上面还提供了2007 Getjar评选出的最佳手机应用软件,上面很多软件都很不错,获奖的几个软件分别为:Opera Mini;RDM+ Remote Desktop for Mobiles, Standard version;Dictionary;Army vs. Crime v1.02;Nav4All。相信在Getjar你能找到适合您自己的手机软件。链...

88个Blog常用工具集锦

Adminimizer ToolbarInternet Explorer 6中,更新您的Blog 最容易的工具。ashnews 一个使用PHP/MySQL打造的简单程序,允许您很容易就添加一个news/blog 系统到您的站点。AvantBlog 一个非常简单的接口:它允许您通过AvantGo这个网站,从Palm或WinCE 设备张贴一篇blog。b2 一个news/blog 工具b2.evolu...

新手做网站时要关注的10个网站程序

建站程序是站长运营网站的根本。如何选择建站程序,提供适合自己网站会员体系的服务和应用,一直是广大站长朋友比较关心的话题。  NO.1 Discuz!  程序简介:Discuz!是全球范围内用户量最大、覆盖面最广的社区论坛(BBS)产品。作为一套成熟的社区解决方案,Discuz! 的每一次升级都引领着中国互联网的社区化、社交化潮流,经过八年多的发展,Discuz! 所建立的社区技术体系和人机交互模型...

恋吧秘籍:10个你必知的Youtube URL技巧

  提起YouTube,估计已经无人不知,无人不晓了吧。说它是视频网站的鼻祖并不为过,国内的视频网站,如优酷网、六间房都是仿照YouTube制作的。根据Alexa世界排名数据,YouTube是仅次于Google、Yahoo的世界第三大网站。因此,去YouTube看视频是大家常常会做的事。今天向大家介绍一些关于YouTube URL的技巧,通过这些常用技巧,也许你会发现,除了在线看视频、搜索外,通过...

TwitterForBusyPeople:适合大忙人的twitter第三方应用

TwitterForBusyPeople故名思意就是专门为那些比较忙的人提供的一个twitter第三方服务。只要你输入你的Twitter用户名(无需密码),就可以查看你Follow的好友的更新情况,并且按照最后一次更新的时间进行分类,包括在1小时内更新的好友,过去一天内更新的好友,一天之前更新的好友。鼠标悬停在好友头像上,可以查看其最新的一条tweets。很显然,如果你忙的好几天才能上一次twti...

发表评论

访客

◎欢迎参与讨论,请在这里发表您的看法和观点。