栏目分类:
子分类:
返回
名师互学网用户登录
快速导航关闭
当前搜索
当前分类
子分类
实用工具
热门搜索
名师互学网 > IT > 系统运维 > 运维 > Linux

centos8.0 软件仓库报错Failed to synchronize cache for repo ‘base‘, ignoring this repo.

Linux 更新时间: 发布时间: IT归档 最新发布 模块sitemap 名妆网 法律咨询 聚返吧 英语巴士网 伯小乐 网商动力

centos8.0 软件仓库报错Failed to synchronize cache for repo ‘base‘, ignoring this repo.

遇到的问题

以使用curl命令安装阿里centos8的镜像仓库,使用dnf repolist查看仓库时遇见如下报错

[root@localhost ~]# yum repolist
CentOS-8 - AppStream - mirrors.aliyun.com                   0.0  B/s |   0  B     00:24    
CentOS-8 - base - mirrors.aliyun.com                        0.0  B/s |   0  B     00:24    
Failed to synchronize cache for repo 'AppStream', ignoring this repo.
Failed to synchronize cache for repo 'base', ignoring this repo.
Last metadata expiration check: 0:23:35 ago on Wed 02 Feb 2022 08:52:22 AM EST.
repo id                    repo name                                                  status
extras                     CentOS-8 - Extras - mirrors.aliyun.com                     38
解决方法

查看dnf日志文件(/var/log/dnf.log)

2022-02-02T14:37:46Z DEBUG Cannot download 'https://mirrors.aliyun.com/centos/8/baseOS/x86_64/os/': Cannot download repomd.xml: Cannot download repodata/repomd.xml: All mirrors were tried.
2022-02-02T14:37:46Z DEBUG repo: downloading from remote: base
2022-02-02T14:37:56Z DEBUG not found other for: CentOS-8 - base - mirrors.aliyun.com
2022-02-02T14:37:56Z DEBUG not found modules for: CentOS-8 - base - mirrors.aliyun.com

发现报错原因,并参试使用浏览器访问该网站,发现访问不了,可能是阿里方面维护或下线了该仓库

将软件仓库更改成华为仓库

# 删除原来的阿里软件仓库
[root@localhost ~]# rm -rf /etc/yum.repos.d/CentOS-base.repo
# 下载华为centos8版本的软件仓库
[root@localhost ~]# curl -o /etc/yum.repos.d/CentOS-base.repo https://repo.huaweicloud.com/repository/conf/CentOS-8-reg.repo

再次测试仓库是否可用

# 清理仓库缓存
[root@localhost ~]# dnf clean all
# 重新生成缓存并查看仓库软件包数量
[root@localhost ~]# dnf repolist
CentOS-8 - AppStream - repo.huaweicloud.com                 2.0 MB/s | 8.4 MB     00:04    
CentOS-8 - base - repo.huaweicloud.com                      1.6 MB/s | 4.6 MB     00:02    
CentOS-8 - PowerTools - repo.huaweicloud.com                866 kB/s | 2.3 MB     00:02    
CentOS-8 - Extras - repo.huaweicloud.com                    4.3 kB/s |  10 kB     00:02    
repo id                   repo name                                                   status
AppStream                 CentOS-8 - AppStream - repo.huaweicloud.com                 5,596
baseOS                    CentOS-8 - base - repo.huaweicloud.com                      1,896
PowerTools                CentOS-8 - PowerTools - repo.huaweicloud.com                1,693
extras                    CentOS-8 - Extras - repo.huaweicloud.com                       38

可以看到,软件仓库已经没有问题

转载请注明:文章转载自 www.mshxw.com
本文地址:https://www.mshxw.com/it/728596.html
我们一直用心在做
关于我们 文章归档 网站地图 联系我们

版权所有 (c)2021-2022 MSHXW.COM

ICP备案号:晋ICP备2021003244-6号