CentOS使用yum時出現try other mirror錯誤時解決方案


此非專業說明,只是提供可能性

嘗試三個方案(逐一嘗試,直至  顯示complete完畢!)

一、更新yum,輸入

yum clean all

yum makecache

yum update

二、若不行,可能是因為DNS不穩定吧,因為yum安裝時會從三個”repo源“(base,extras,updates)隨機獲取地址

①編輯網絡配置:vi /etc/sysconfig/network-scripts/ifcfg-eth0

在本地網關DNS1下,添加aliyun網關 DNS2=223.5.5.5(可以理解為:將base,updates的“repo源”換為aliyun的)

重啟網絡服務:service network restart

②上步驟若還不行,請繼續以下步驟(換源,可以理解為上一步的plus吧,再將extras換為aliyun的,重在解決,我也不是很了解)

1、為防止錯誤,先備份一份:mv /etc/yum.repos.d/CentOS-Base.repo /etc/yum.repos.d/CentOS-Base.repo.backup

2、CentOS6下:wget -O /etc/yum.repos.d/CentOS-Base.repo http://mirrors.aliyun.com/repo/Centos-6.repo
CentOS7下:wget -O /etc/yum.repos.d/CentOS-Base.repo http://mirrors.aliyun.com/repo/Centos-7.repo

3、刷新並生成緩存:yum clean all && yum makecache

三、若是實在不行:可下載tar包安裝

1、得到tar包

2、解壓:tar -xvf tar包

3、安裝:yum localinstall *.rpm -y

4、啟動:service mysqld start

若啟動失敗,輸入:rm -fr /var/lib/mysql/*     再啟動:service mysqld start

 


免責聲明!

本站轉載的文章為個人學習借鑒使用,本站對版權不負任何法律責任。如果侵犯了您的隱私權益,請聯系本站郵箱yoyou2525@163.com刪除。



 
粵ICP備18138465號   © 2018-2025 CODEPRJ.COM