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

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

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

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://www.432l.com/post/9746.html

分享给朋友:

相关文章

网站提交入口及网站优化工具

 以下是可以快速提交到中文各大搜索引擎的工具:http://db.sohu.com/regurl/regform.asphttp://www.yisou.com/search_submit.htmlhttp://www.google.com/intl/zh-CN/add_url.htmlhttp://service.chinasearch.com.cn/NetSearch/user_re...

z-blog的主题制作技巧与诀窍

1.更新浏览计数在打开单页日志后产生,每刷新一次,计数加1。注意:只有在b_article-single.html有以下及第3步中介绍的代码,浏览计数才有效。在b_article-single.html模板中,你认为合适的位置加入以下代码,<span>标签内显示的就是当前文章的浏览次数。<span id="spn<#article/id#>">...

戳穿网赚虚假广告以及防骗技巧

        骗术拆解: 目前骗子广告联盟非常多,像王鑫这样被骗的案例也不在少数。价高、挂马、拒付、扣量、K号、支付周期短等手段是骗子广告联盟常用的手段,本案例中,涉及了价高、挂马、拒付、扣量、支付周期短等骗术,该联盟提供的图片类广告、文字类广告、弹窗类广告比同类正规的广告联盟高(一般10元/千IP)。    &nb...

Web2.0设计生成工具

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

WebApp网站列表:适合于网站/Blog的在线聊天服务

这里总结的在线聊天服务是一类适合于网站/Blog方便读者直接在线交流,或者直接通过IM等工具和在线读者交流的服务。1.Geesee属于一个在线聊天室,提供blog或网站嵌入功能,也提供外链的聊天室,界面很漂亮,支持中文。简单注册之后就可以开始建立自己的聊天室。你可以定制你的聊天室(内嵌如网页的尺寸),操作步骤很简单。详细介绍。2.Hab.la:加入一段简单的Javascript代码,可以使你和访问...

PostRank:带评分的RSS工具

“天涯海阁”改版之后,在首页用很多篇幅作了热文版块(历史热文、当日热文、Digg热文),正是希望有很好的导读性,也希望添加更多的交互元素。这些功能我们都是通过Wordpress 插件实现,但这些也许在一定程度上影响一些后台运行的速度。如果你对热文功能不高,只需要简单的评分,完全可以通过PostRank 实现。你只需要简单的输入和设置,就可以得到带有评分的RSS Widget...

发表评论

访客

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