阿里云 yum 安装应用报 404 错误
类别: 工作日志 阿里云 标签: Linux CentOS sed yum目录
今天登录阿里云安装应用出现 404
问题
yum install install httpd-tools -y
CentOS-8 - AppStream 9.6 kB/s | 2.3 kB 00:00
Errors during downloading metadata for repository 'AppStream':
- Status code: 404 for http://mirrors.cloud.aliyuncs.com/centos/8/AppStream/x86_64/os/repodata/repomd.xml (IP: 100.100.2.148)
错误:为 repo 'AppStream' 下载元数据失败 : Cannot download repomd.xml: Cannot download repodata/repomd.xml: All mirrors were tried
解决方案
cd /etc/yum.repos.d/
find . -name '*.repo' -exec sed -i 's/mirrors.cloud.aliyuncs.com/mirrors.aliyun.com/g' {} +
find . -name '*.repo' -exec sed -i 's/$releasever/$releasever-stream/g' {} +
或
for i in `ls`;do sed -i 's/mirrors.cloud.aliyuncs.com/mirrors.aliyun.com/g' $i;done
for i in `ls`;do sed -i 's/$releasever/$releasever-stream/g' $i;done
yum clean all
yum makecache
yum install httpd-tools -y