| 
 停止維護 CentOS Yum  
 
 
CentOS6系列於2020年11月30號之後停止維護了,故原本的yum源已無法使用,對於我這個從2012年就持續使用CentOS6到現在的忠實粉絲來說實在太可怕了,從來沒有想過這麼大品牌的OpenSource也有在網路上消失的一天,而且還來得這麼快 
 
 
未更新前使用yum出現的錯誤訊息 
 
- [root@test ~]# yum install php 
 
 - Loaded plugins: fastestmirror Determining fastest mirrors YumRepo Error: All mirror URLs are not using ftp, http[s] or file. Eg. Invalid release/repo/arch combination/ removing mirrorlist with no valid mirrors: /var/cache/yum/x86_64/6/base/mirrorlist.txt Error: Cannot find a valid baseurl for repo: base
 
  複製代碼 
vi /etc/yum/pluginconf.d/fastestmirror.conf,將enabled參數改為零 - [main]
 
 - enabled=0
 
 - verbose=0
 
 - always_print_best_host = true
 
 - socket_timeout=3
 
 - #  Relative paths are relative to the cachedir (and so works for users as well
 
 - # as root).
 
 - hostfilepath=timedhosts.txt
 
 - maxhostfileage=10
 
 - maxthreads=15
 
 - #exclude=.gov, facebook
 
 - #include_only=.nl,.de,.uk,.ie
 
  複製代碼 
或是輸入以下指令快速修改 
 
- sed -i "s|enabled=1|enabled=0|g" /etc/yum/pluginconf.d/fastestmirror.conf
 
  複製代碼 
備份原本的yum源 
 
- [root@test ~]# cd /etc/yum.repos.d
 
 - [root@test yum.repos.d]# mv CentOS-Base.repo CentOS-Base.repo-bak
 
  複製代碼 
下載官方替代的vault源 
 
- curl -o /etc/yum.repos.d/CentOS-Base.repo https://www.xmpan.com/Centos-6-Vault-Official.repo
 
  複製代碼 
清除緩存和更新套件資料庫 
 
- # yum clean all && yum makecache
 
  複製代碼 
 
國內很多站點都已經刪檔了,我這邊有找到美國加州大學的可用站點 http://mirrors.oit.uci.edu/centos/6.10/os/x86_64/ 
速度較快,先搶先贏唷! 
 
文章出處 
 |