错误:为仓库 'AppStream' 下载元数据失败 : Cannot prepare internal mirrorlist: No URLs in mirrorlist
目录
一、域名解析
二、CentOS-AppStream.repo
三、CentOS-Base.repo
四、CentOS-Extras.repo
五、rpm更新
一、域名解析
先验证 ping www.baidu.com 不ok则添加域名解析,ok的页建议
[root@localhost ~]# vim /etc/resolv.conf
nameserver 8.8.8.8
nameserver 114.114.114.114
重启网络服务,如有启动不成功(centos版本问题,不支持,)
添加镜像源,并更新rpm
不支持:
[root@localhost ~]# service network restart
Redirecting to /bin/systemctl restart network.service
则尝试:service networking restart 或者
[root@localhost yum.repos.d]# nmcli c reload
二、CentOS-AppStream.repo
#[AppStream]
#name=CentOS-$releasever - AppStream
#mirrorlist=http://mirrorlist.centos.org/?release=$releasever&arch=$basearch&repo=AppStream&infra=$infra
#baseurl=http://mirror.centos.org/$contentdir/$releasever/AppStream/$basearch/os/
#gpgcheck=1
#enabled=1
#gpgkey=file:///etc/pki/rpm-gpg/RPM-GPG-KEY-centosofficial[AppStream]
name=CentOS-$releasever - AppStream
baseurl=https://mirrors.aliyun.com/centos/$releasever/AppStream/$basearch/os/
gpgcheck=1
enabled=1
gpgkey=file:///etc/pki/rpm-gpg/RPM-GPG-KEY-centosofficial
三、CentOS-Base.repo
#[BaseOS]
#name=CentOS-$releasever - Base
#mirrorlist=http://mirrorlist.centos.org/?release=$releasever&arch=$basearch&repo=BaseOS&infra=$infra
#baseurl=http://mirror.centos.org/$contentdir/$releasever/BaseOS/$basearch/os/
#gpgcheck=1
#enabled=1
#gpgkey=file:///etc/pki/rpm-gpg/RPM-GPG-KEY-centosofficial[BaseOS]
name=CentOS-$releasever - Base
baseurl=https://mirrors.aliyun.com/centos/$releasever/BaseOS/$basearch/os/
gpgcheck=1
enabled=1
gpgkey=file:///etc/pki/rpm-gpg/RPM-GPG-KEY-centosofficial
四、CentOS-Extras.repo
#additional packages that may be useful
[extras]
#name=CentOS-$releasever - Extras
#mirrorlist=http://mirrorlist.centos.org/?release=$releasever&arch=$basearch&repo=extras&infra=$infra
#baseurl=http://mirror.centos.org/$contentdir/$releasever/extras/$basearch/os/
#gpgcheck=1
#enabled=1
#gpgkey=file:///etc/pki/rpm-gpg/RPM-GPG-KEY-centosofficialname=CentOS-$releasever - Extras
baseurl=https://mirrors.aliyun.com/centos/$releasever/BaseOS/$basearch/os/
gpgcheck=1
enabled=1
gpgkey=file:///etc/pki/rpm-gpg/RPM-GPG-KEY-centosofficial
五、rpm更新
[root@localhost yum.repos.d]# dnf update dnf rpm -y
六、再次尝试之前的命令文章来源:https://www.toymoban.com/news/detail-652827.html
如docker安装:文章来源地址https://www.toymoban.com/news/detail-652827.html
sudo yum install -y yum-utils
到了这里,关于AppStream下载元数据失败的文章就介绍完了。如果您还想了解更多内容,请在右上角搜索TOY模板网以前的文章或继续浏览下面的相关文章,希望大家以后多多支持TOY模板网!