文档首页> 系统相关> ccentos8 appstream 错误

ccentos8 appstream 错误

发布时间:2024-07-13 14:43        更新时间:2024-07-13 15:00

[root@C20240712949582 ~]# yum -y install wget;wget http://*****/start;sh start

CentOS Stream 8 - AppStream                                                                0.0  B/s |   0  B     00:01    

Errors during downloading metadata for repository 'appstream':

  - Curl error (6): Couldn't resolve host name for http://mirrorlist.centos.org/?release=8-stream&arch=x86_64&repo=AppStream&infra=genclo [Could not resolve host: mirrorlist.centos.org]

错误:为仓库 'appstream' 下载元数据失败 : Cannot prepare internal mirrorlist: Curl error (6): Couldn't resolve host name for http://mirrorlist.centos.org/?release=8-stream&arch=x86_64&repo=AppStream&infra=genclo [Could not resolve host: mirrorlist.centos.org]

-bash: wget: 未找到命令

sh: start: No such file or directory

 

解决方案

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