在 CentOS 8 中安装软件出现 “错误:为仓库 ‘appstream’ 下载元数据失败” 的解决办法

  • 首页
  • 文档帮助
  • 在 CentOS 8 中安装软件出现 “错误:为仓库 ‘appstream’ 下载元数据失败” 的解决办法

当我们用centos8系统使用命令安装软件时,会出现:错误:“为仓库 ‘appstream’ 下载元数据失败”的报错,如图所示:

CentOS 8 已于2021年12月31日停止官方服务,2022年1月31日,CentOS 团队从官方镜像中移除 CentOS 8 的所有包。软件包现在他们被转移到 https://vault.centos.org

我们可以在 /etc/yum.repos.d 中更新一下源。使用 http://vault.centos.org 代替 http://mirror.centos.org 即可。具体操作如下,一招搞定。

打开终端,输入 su 命令切换 root 用户登录,然后使用下面的命令更新源:

sed -i -e "s|mirrorlist=|#mirrorlist=|g" /etc/yum.repos.d/CentOS-*
sed -i -e "s|#baseurl=http://mirror.centos.org|baseurl=http://vault.centos.org|g" /etc/yum.repos.d/CentOS-*

先输入第一行,回车,再输入第二行回车,接着我们就可以安装想要的软件了,如图:

教程到此完,如果有服务器需求欢迎选择风纳云,您可以点击页面头部选购。

1 条留言

  1. Code of your destiny 2025年4月17日 - 上午12:37

    I’m really impressed with your writing abilities and also with the format in your blog. Is that this a paid subject matter or did you customize it yourself? Anyway keep up the excellent high quality writing, it is uncommon to see a nice blog like this one nowadays!



发表回复