佳木斯湛栽影视文化发展公司

主頁 > 知識庫 > 詳解CentOS8更換yum源后出現(xiàn)同步倉庫緩存失敗的問題

詳解CentOS8更換yum源后出現(xiàn)同步倉庫緩存失敗的問題

熱門標簽:網(wǎng)站建設 檢查注冊表項 美圖手機 阿里云 硅谷的囚徒呼叫中心 百度競價點擊價格的計算公式 使用U盤裝系統(tǒng) 智能手機

問題起因:一開始CentOS 8默認的yum源是能夠正常使用的,但使用如下命令安裝了Development Tools之后:

yum groupinstall -y "Development Tools"

不知道為啥就開始出現(xiàn)同步倉庫緩存失敗的問題,無法正常安裝一些工具包。錯誤提示如下:

[root@localhost /etc/yum.repos.d]# yum makecache
CentOS-8.0 - AppStream                  19 B/s | 38 B   00:02  
CentOS-8.0 - Base                     24 B/s | 38 B   00:01  
CentOS-8.0 - Extras                    8.4 B/s | 38 B   00:04  
同步倉庫 'AppStream' 緩存失敗,忽略這個 repo。
同步倉庫 'BaseOS' 緩存失敗,忽略這個 repo。
同步倉庫 'extras' 緩存失敗,忽略這個 repo。
元數(shù)據(jù)緩存已建立。
[root@localhost /etc/yum.repos.d]#

于是根據(jù)錯誤提示信息到網(wǎng)上查找相關解決方案,大部分都是說更換阿里的yum源,然后就按官方文檔的說明進行了更換:

https://developer.aliyun.com/mirror/centos

本來以為已經(jīng)順利解決了,想不到還有坑,重新建立元數(shù)據(jù)緩存時依舊提示同步倉庫緩存失?。?/p>

[root@mesos-master /etc/yum.repos.d]# yum makecache
CentOS-8.0 - AppStream - mirrors.aliyun.com          0.0 B/s |  0 B   00:24  
CentOS-8.0 - Base - mirrors.aliyun.com            0.0 B/s |  0 B   00:32  
CentOS-8.0 - Extras - mirrors.aliyun.com           0.0 B/s |  0 B   00:32  
CentOS-8.0 - Epel                       2.3 MB/s | 6.0 MB   00:02  
WANdisco SVN Repo 1.9                     2.0 kB/s | 121 kB   01:01  
同步倉庫 'AppStream' 緩存失敗,忽略這個 repo。
同步倉庫 'base' 緩存失敗,忽略這個 repo。
同步倉庫 'extras' 緩存失敗,忽略這個 repo。
上次元數(shù)據(jù)過期檢查:0:00:01 前,執(zhí)行于 2020年03月23日 星期一 10時26分48秒。
元數(shù)據(jù)緩存已建立。
[root@mesos-master /etc/yum.repos.d]#

然后百思不得其解,我尋思系統(tǒng)默認的yum源可能因為網(wǎng)絡的原因連不上也就算了,國內(nèi)的源不應該啊,是不是配置有問題呢?結果還真是,baseurl中的$releasever和$basearch占位符不知為何無效。故將$releasever改為8,將$basearch改為x86_64后問題解決。修改后的各個配置文件內(nèi)容如下:

### 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

做完以上修改后問題解決,沒有再提示同步倉庫緩存失敗了:

[root@localhost /etc/yum.repos.d]# yum makecache
CentOS-8 - AppStream - mirrors.aliyun.com           2.1 MB/s | 6.5 MB   00:03  
CentOS-8 - Base - mirrors.aliyun.com              1.6 MB/s | 5.0 MB   00:03  
CentOS-8 - Extras - mirrors.aliyun.com             1.8 kB/s | 4.2 kB   00:02  
CentOS-8.0 - Epel                       2.2 MB/s | 6.0 MB   00:02  
WANdisco SVN Repo 1.9                     10 kB/s | 121 kB   00:11  
元數(shù)據(jù)緩存已建立。
[root@localhost /etc/yum.repos.d]# 

到此這篇關于詳解CentOS8更換yum源后出現(xiàn)同步倉庫緩存失敗的問題的文章就介紹到這了,更多相關CentOS8更換yum源同步倉庫失敗內(nèi)容請搜索腳本之家以前的文章或繼續(xù)瀏覽下面的相關文章希望大家以后多多支持腳本之家!

標簽:通遼 山南 湘潭 黃山 湖北 賀州 懷化 煙臺

巨人網(wǎng)絡通訊聲明:本文標題《詳解CentOS8更換yum源后出現(xiàn)同步倉庫緩存失敗的問題》,本文關鍵詞  ;如發(fā)現(xiàn)本文內(nèi)容存在版權問題,煩請?zhí)峁┫嚓P信息告之我們,我們將及時溝通與處理。本站內(nèi)容系統(tǒng)采集于網(wǎng)絡,涉及言論、版權與本站無關。
  • 相關文章
  • 收縮
    • 微信客服
    • 微信二維碼
    • 電話咨詢

    • 400-1100-266
    堆龙德庆县| 依兰县| 和硕县| 咸丰县| 巩留县| 安岳县| 福州市| 周至县| 张家港市| 曲水县| 左权县| 中江县| 宾川县| 射阳县| 揭东县| 留坝县| 平山县| 搜索| 登封市| 泰兴市| 赣榆县| 宜兴市| 沙洋县| 香河县| 朝阳区| 泾阳县| 云南省| 麻江县| 阜南县| 新绛县| 三原县| 潼关县| 伊春市| 柞水县| 滁州市| 清涧县| 临夏市| 南木林县| 铁力市| 平泉县| 平顺县|