Error: Failed to download metadata for repo ‘powertools’: Cannot prepare internal mirrorlist: No URLs
原因:
CentOS Linux 8 已于 2021 年 12 月 31 日结束生命周期 (EOL)。这意味着 CentOS 8 将不再从 CentOS 官方项目获得开发资源。
解决
首先建立一个备份文件夹
makedir /tmp/yum
然后备份文件
cd /etc/yum.repos.d
mv *.repo /tmp/yum
然后安装阿里源
wget -O /etc/yum.repos.d/CentOS-Base.repo https://mirrors.aliyun.com/repo/Centos-vault-8.5.2111.repo
然后清除yum缓存再重新生成yum缓存
yum clean all
yum makecache
如果报如下类似错误
Timeout was reached for
http://mirrors.aliyuncs.com/centos/8/BaseOS/x86_64/os/repodata/repomd.xml
[Connection timed out after 30000 milliseconds] Could not resolve
host: mirrors.cloud.aliyuncs.com
则执行如下命令
sed -i -e '/mirrors.cloud.aliyuncs.com/d' -e '/mirrors.aliyuncs.com/d' /etc/yum.repos.d/CentOS-Base.repo
参考阿里源链接:https://developer.aliyun.com/mirror/centos?spm=a2c6h.13651102.0.0.3e221b11QTXSya
centos8 Error: yum Failed to download metadata for repo ‘AppStream’-CSDN博客
完美解决CentOS8 yum安装AppStream报错,更新yum后无法makecache的问题 – 白_胖_子 – 博客园 (cnblogs.com)
原创文章,作者:奋斗,如若转载,请注明出处:https://blog.ytso.com/tech/aiops/306875.html