出现Failed to download metadata for repo ‘AppStream‘问题解决

Linux学习笔记总结(一百零四)-Centos8出现Failed to download metadata for repo 'AppStream'问题解决

大家都知道Centos8于2021年年底停止了服务,大家再在使用yum源安装时候,出现下面错误“错误:Failed to download metadata for repo 'AppStream': Cannot prepare internal mirrorlist: No URLs in mirrorlist”

最终原因还是源的问题,解决办法也是解决源的问题。

解决办法如下:

1、进入yum的repos目录

命令:

cd /etc/yum.repos.d/

2、修改所有的CentOS文件内容

命令:

sed -i 's/mirrorlist/#mirrorlist/g' /etc/yum.repos.d/CentOS-*

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

3、更新yum源为阿里镜像

命令:

wget -O /etc/yum.repos.d/CentOS-Base.repo https://mirrors.aliyun.com/repo/Centos-vault-8.5.2111.repo

yum clean all

yum makecache

4、yum安装测试是否可以yum安装

命令:

yum install wget –y

问题解决。

  • 17
    点赞
  • 42
    收藏
    觉得还不错? 一键收藏
  • 0
    评论
Hello! I'm C知道, a ChatGPT-based AI developed by CSDN. I'm here to help you with your question. Regarding the error message "Failed to download metadata for repo AppStream," it typically occurs when your system is unable to fetch the metadata for the AppStream repository. This repository contains metadata about available packages and their dependencies. To resolve this issue, you can try the following steps: 1. Check your internet connection: Ensure that you have a stable internet connection to download the metadata. You can try accessing other websites or performing a ping test to verify your connection. 2. Clear the cache: Sometimes, the metadata files might be corrupted or outdated. Clearing the cache may help resolve the issue. You can do this by running the following command: ``` sudo dnf clean all ``` 3. Refresh the repository metadata: Update the repository metadata by running the following command: ``` sudo dnf makecache ``` 4. Disable the specific repository: If the issue persists, you can try disabling the AppStream repository temporarily and see if it resolves the problem. To disable the repository, open the YUM or DNF configuration file (usually located in `/etc/yum.repos.d/`) and set `enabled=0` for the AppStream repository. 5. Check your mirror configuration: If you're using a mirror for package downloads, ensure that it is correctly configured and working. You can try switching to a different mirror or using the default repositories. If none of these steps work, please provide more details about your system, such as the Linux distribution and version you're using, any recent changes or updates made to your system, and any other relevant error messages you encounter. This information will help in troubleshooting the issue further.

“相关推荐”对你有帮助么?

  • 非常没帮助
  • 没帮助
  • 一般
  • 有帮助
  • 非常有帮助
提交
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值