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

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

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

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

分享给朋友:

相关文章

恋吧发现并推荐一个博客同步工具—BlogSync

BlogSync是一个在博客之间进行同步复制的工具,它会自动比较两个博客之间的差异,找出不同的文章并列出来,供使用者选择,然后执行复制操作。经BlogSync复制的帖子可以保留原本的排版样式、发帖时间以及标签。你可以用BlogSync方便地维护镜像站点,也可以把它作为一个搬家工具。目前BlogSync支持Blogger(GDATA API)、MSN Live Spaces、WordPress、Dr...

试试nomee:集众多功能于一身的AIR应用,很炫吧!

想必大家都听过多次all-in-one这个词组,比如著名的Firefox的all-in-one扩展。那么你应该对all-in-one的概念不会陌生。all-in-one就是集众多功能于一身,合而为一。   神奇的AIR应用,也有all-in-one了。集众多功能于一身的nomee,可以用来管理众多社会化网络应用。这款基于Adobe AIR的all-in-one应用可以简化并组织各大SNS中的内容,...

假如没有Google ,很有感触的一篇文章!

没了blogger ,得每年花银子合租服务器去写博客没了YouTube,只能拿着国内饱经河蟹的视频站打花时间没了maps ,出门找不见地,手机开着google maps没法利用信号机架确定我在哪,迷路….没了calendar,没人会悄悄的免费发短信提醒我:今天是某MM 的生日……没了reader,很高兴的告诉自己,一天可以多出3个小时啦!没了picasa,...

Tweetake—备份twitter的利器

尽管玩 twitter时间不长,尽管不是骨灰级推油,之前从未考虑过twitter 的备份问题,前不久看见有推油提到 twitter 备份这个话题,那么,就一起来探讨一下吧。为什么要备份 twitter博客备份的概念已经深入人心,但twitter备份的习惯并不是很多人有,twitter有必要备份吗?当然。下面仅列出几个twitter需要备份的原因: twitter常常...

TweetBoard.com:把Twitter放到自己的网站上

网站介绍:TweetBoard是一个基于Twitter的网站聊天室,可以将Twitter和自己的网站完美结合在一起,效果非常cool~TweetBoard可以实时处理你的Twitter信息流(最大延迟时间为1分钟),因此你可以把它跟Twitter账号一起用,并应用到任何网站(通过在网站中插入TweetBoard提供的代码)。你在TweetBoard上发布的消息会同时显示在Twitter上,并且可以...

PutACart.com:让你在网络上随时随地买卖商品

  网站介绍:或许,有的时候,互联网上,你所需要的就是一个Google、Myspace,一个梦想,还有,一个“购物车”(shopping cart)?PutACart.com让你在互联网上,可以随时随地地买卖商品(Sell anything anywhere)。 即便现在电子商务网站和服务已经非常多,你是不是还是觉得很麻烦?或许,你可以试试Pu...

发表评论

访客

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