详解CentOS8更换yum源后出现同步仓库缓存失败的问题

简介: 详解CentOS8更换yum源后出现同步仓库缓存失败的问题

不知道为啥就开始出现同步仓库缓存失败的问题,无法正常安装一些工具包。错误提示如下:

上报错!!!

然后百思不得其解,我寻思系统默认的yum源可能因为网络的原因连不上也就算了,国内的源不应该啊,是不是配置有问题呢?结果还真是,baseurl中的$releasever和$basearch占位符不知为何无效。故将$releasever改为8,将$basearch改为x86_64后问题解决。修改后的各个配置文件内容如下:

### cat CentOS-Base.repo ###
[base]
name=CentOS-8 - Base - mirrors.aliyun.com
failovermethod=priority
baseurl=https://mirrors.aliyun.com/centos/8/BaseOS/x86_64/os/
     http://mirrors.aliyuncs.com/centos/8/BaseOS/x86_64/os/
     http://mirrors.cloud.aliyuncs.com/centos/8/BaseOS/x86_64/os/
gpgcheck=1
gpgkey=https://mirrors.aliyun.com/centos/RPM-GPG-KEY-CentOS-Official
### cat CentOS-AppStream.repo ###
[AppStream]
name=CentOS-8 - AppStream - mirrors.aliyun.com
failovermethod=priority
baseurl=https://mirrors.aliyun.com/centos/8/AppStream/x86_64/os/
     http://mirrors.aliyuncs.com/centos/8/AppStream/x86_64/os/
     http://mirrors.cloud.aliyuncs.com/centos/8/AppStream/x86_64/os/
gpgcheck=1
gpgkey=https://mirrors.aliyun.com/centos/RPM-GPG-KEY-CentOS-Official
### cat CentOS-Extras.repo ###
[extras]
name=CentOS-8 - Extras - mirrors.aliyun.com
failovermethod=priority
baseurl=https://mirrors.aliyun.com/centos/8/extras/x86_64/os/
     http://mirrors.aliyuncs.com/centos/8/extras/x86_64/os/
     http://mirrors.cloud.aliyuncs.com/centos/8/extras/x86_64/os/
gpgcheck=1
gpgkey=https://mirrors.aliyun.com/centos/RPM-GPG-KEY-CentOS-Official
### cat CentOS-Epel.repo ###
[epel]
name=CentOS-$releasever - Epel
baseurl=http://mirrors.aliyun.com/epel/8/Everything/$basearch
enabled=1
gpgcheck=0
### cat CentOS-PowerTools.repo ###
[PowerTools]
name=CentOS-8 - PowerTools - mirrors.aliyun.com
failovermethod=priority
baseurl=https://mirrors.aliyun.com/centos/8/PowerTools/x86_64/os/
     http://mirrors.aliyuncs.com/centos/8/PowerTools/x86_64/os/
     http://mirrors.cloud.aliyuncs.com/centos/8/PowerTools/x86_64/os/
gpgcheck=1
enabled=0
gpgkey=https://mirrors.aliyun.com/centos/RPM-GPG-KEY-CentOS-Official
### cat CentOS-centosplus.repo ###
[centosplus]
name=CentOS-8 - Plus - mirrors.aliyun.com
failovermethod=priority
baseurl=https://mirrors.aliyun.com/centos/8/centosplus/x86_64/os/
     http://mirrors.aliyuncs.com/centos/8/centosplus/x86_64/os/
     http://mirrors.cloud.aliyuncs.com/centos/8/centosplus/x86_64/os/
gpgcheck=1
enabled=0
gpgkey=https://mirrors.aliyun.com/centos/RPM-GPG-KEY-CentOS-Official

做完以上修改后问题解决,没有再提示同步仓库缓存失败了:

 

目录
相关文章
|
canal 缓存 NoSQL
Redis缓存与数据库如何保证一致性?同步删除+延时双删+异步监听+多重保障方案
根据对一致性的要求程度,提出多种解决方案:同步删除、同步删除+可靠消息、延时双删、异步监听+可靠消息、多重保障方案
Redis缓存与数据库如何保证一致性?同步删除+延时双删+异步监听+多重保障方案
|
关系型数据库 MySQL Linux
MySQL8官方YUM仓库使用指南
MySQL 8 是广受欢迎的开源关系数据库管理系统,引入了诸多新特性和性能提升。本文介绍如何在 Linux 上通过 MySQL 官方 YUM 仓库安装和管理 MySQL 8。首先配置 YUM 仓库并安装 MySQL,启动服务后获取临时密码并登录。接着创建数据库与用户,使用 SQL 命令创建表格、插入及查询数据。此方法简便高效,适合快速上手 MySQL 8 的基本操作。
1417 13
|
缓存 Linux 数据库
CentOS 8中 更新或下载时报错:为仓库 ‘appstream‘ 下载元数据失败 : Cannot prepare internal
通过以上步骤,您可以有效地解决 CentOS 8 中“为仓库 ‘appstream’ 下载元数据失败 : Cannot prepare internal”问题。关键在于检查网络连接、更新和切换仓库配置、清理缓存、重建 RPM 数据库以及在必要时临时禁用有问题的仓库。通过这些方法,可以确保系统能够正常进行软件包的更新和下载操作。
4430 20
Centos8同步时间(阿里云NTP服务为例)
Centos8同步时间(阿里云NTP服务为例)
2529 1
|
Ubuntu Python
银河麒麟-麒麟软件操作系统 kylin 搭建yum源 ubuntu搭建yum源 yum软件仓库搭建ftp源、python源、硬盘源
银河麒麟-麒麟软件操作系统 kylin 搭建yum源 ubuntu搭建yum源 yum软件仓库搭建ftp源、python源、硬盘源
3417 1
|
缓存 Linux 测试技术
搭建本地YUM仓库
在Redhat 9系统中,通过挂载系统安装盘到/mnt,然后创建本地YUM仓库以实现软件包管理。首先查看磁盘挂载情况,将ISO镜像挂载到/mnt。接着,备份`/etc/yum.repos.d/`目录内容,删除原有仓库,创建`loaclhost.repo`文件并配置指向/mnt中的Package目录。运行`yum clean all`清除缓存,`yum makecache`建立元数据。最后,成功通过新配置的本地仓库安装了bind软件及其依赖。
1019 3
|
缓存 Linux 网络安全
解决 CentOS 7 官方 yum 仓库无法使用的最佳实践
【8月更文挑战第18天】若 CentOS 7 的官方 YUM 仓库无法使用,可按以下步骤解决: 1. **检查网络连接**: - 确认服务器能正常上网,可通过访问外部网站或网络诊断测试。 - 检查防火墙设置,避免其阻挡 YUM 的网络访问。 2. **检查 YUM 配置**: - 核实 `/etc/yum.repos.d/` 下的 `CentOS-Base.repo` 文件中仓库地址正确无误。 - 确认配置文件内的 `enabled` 选项设为 `1` 以启用仓库。
7404 0
|
缓存 Linux 开发工具
centos设置ntp服务同步目标服务器时间
【7 月更文挑战第 1天】linux+centos设置ntp服务同步目标服务器时间
|
Linux
Centos7同步时间(阿里云NTP服务为例)
Centos7同步时间(阿里云NTP服务为例)
6392 0