CentOS系統(tǒng)使用yum命令報錯問題及解決
更新時間:2024年12月28日 09:32:28 作者:程序員阿明
文章主要講述了在CentOS系統(tǒng)中使用yum命令時遇到的錯誤,并提供了個人解決方法,希望對大家有所幫助,并鼓勵大家支持腳本之家
CentOS系統(tǒng)使用yum命令報錯
找到文件
/etc/yum.repos.d/CentOS-Base.repo
替換源文件為
# CentOS-Base.repo
#
# The mirror system uses the connecting IP address of the client and the
# update status of each mirror to pick mirrors that are updated to and
# geographically close to the client. You should use this for CentOS updates
# unless you are manually picking other mirrors.
#
# If the mirrorlist= does not work for you, as a fall back you can try the
# remarked out baseurl= line instead.
#
#
[base]
name=CentOS-$releasever - Base - mirrors.aliyun.com
failovermethod=priority
baseurl=http://mirrors.aliyun.com/centos/$releasever/os/$basearch/
http://mirrors.aliyuncs.com/centos/$releasever/os/$basearch/
http://mirrors.cloud.aliyuncs.com/centos/$releasever/os/$basearch/
gpgcheck=0
gpgkey=http://mirrors.aliyun.com/centos/RPM-GPG-KEY-CentOS-7
#released updates
[updates]
name=CentOS-$releasever - Updates - mirrors.aliyun.com
failovermethod=priority
baseurl=http://mirrors.aliyun.com/centos/$releasever/updates/$basearch/
http://mirrors.aliyuncs.com/centos/$releasever/updates/$basearch/
http://mirrors.cloud.aliyuncs.com/centos/$releasever/updates/$basearch/
gpgcheck=0
gpgkey=http://mirrors.aliyun.com/centos/RPM-GPG-KEY-CentOS-7
#additional packages that may be useful
[extras]
name=CentOS-$releasever - Extras - mirrors.aliyun.com
failovermethod=priority
baseurl=http://mirrors.aliyun.com/centos/$releasever/extras/$basearch/
http://mirrors.aliyuncs.com/centos/$releasever/extras/$basearch/
http://mirrors.cloud.aliyuncs.com/centos/$releasever/extras/$basearch/
gpgcheck=0
gpgkey=http://mirrors.aliyun.com/centos/RPM-GPG-KEY-CentOS-7
#additional packages that extend functionality of existing packages
[centosplus]
name=CentOS-$releasever - Plus - mirrors.aliyun.com
failovermethod=priority
baseurl=http://mirrors.aliyun.com/centos/$releasever/centosplus/$basearch/
http://mirrors.aliyuncs.com/centos/$releasever/centosplus/$basearch/
http://mirrors.cloud.aliyuncs.com/centos/$releasever/centosplus/$basearch/
gpgcheck=0
enabled=0
gpgkey=http://mirrors.aliyun.com/centos/RPM-GPG-KEY-CentOS-7
#contrib - packages by Centos Users
#[contrib]
#name=CentOS-$releasever - Contrib - mirrors.aliyun.com
#failovermethod=priority
#baseurl=http://mirrors.aliyun.com/centos/$releasever/contrib/$basearch/
# http://mirrors.aliyuncs.com/centos/$releasever/contrib/$basearch/
# http://mirrors.cloud.aliyuncs.com/centos/$releasever/contrib/$basearch/
#gpgcheck=1
#enabled=0
#gpgkey=http://mirrors.aliyun.com/centos/RPM-GPG-KEY-CentOS-7
總結(jié)
以上為個人經(jīng)驗(yàn),希望能給大家一個參考,也希望大家多多支持腳本之家。
相關(guān)文章
讓Apache支持Rewrite靜態(tài)頁面重寫的方法
Apache下Rewrite靜態(tài)頁面重寫的方法,需要的朋友可以參考下。2010-07-07
Ubuntu18.04安裝Pycharm教程的實(shí)現(xiàn)
這篇文章主要介紹了Ubuntu18.04安裝Pycharm教程的實(shí)現(xiàn),文中通過示例代碼介紹的非常詳細(xì),對大家的學(xué)習(xí)或者工作具有一定的參考學(xué)習(xí)價值,需要的朋友們下面隨著小編來一起學(xué)習(xí)學(xué)習(xí)吧2019-09-09
CentOS Linux系統(tǒng)搭建Android開發(fā)環(huán)境詳細(xì)介紹
這篇文章主要介紹了CentOS Linux系統(tǒng)搭建Android開發(fā)環(huán)境詳細(xì)介紹的相關(guān)資料,需要的朋友可以參考下2016-11-11
apache中的Worker 和 Prefork 之間的區(qū)別解析
Apache中的Worker和Prefork兩種工作模式在內(nèi)存使用、穩(wěn)定性以及兼容性等方面存在區(qū)別,本文介紹apache中的Worker 和 Prefork 之間的區(qū)別,感興趣的朋友跟隨小編一起看看吧2024-11-11
Linux下通過sed命令對kv方式的配置文件進(jìn)行修改
sed是unix下的面向字符流的編輯器,即stream editor, 它是面向行的,以行為單位進(jìn)行處理,同時,sed是非交互式的,一旦執(zhí)行便要處理完整個文件。這篇文章主要介紹了Linux下通過sed命令對kv方式的配置文件進(jìn)行修改,需要的朋友可以參考下2018-11-11

