TShopping

 找回密碼
 註冊
搜索
查看: 901|回復: 0
打印 上一主題 下一主題

[CentOS] 因應官方停止維護,替你的CentOS6更換Yum源

[複製鏈接]
跳轉到指定樓層
1#
發表於 2022-4-6 16:17:15 | 只看該作者 |只看大圖 回帖獎勵 |倒序瀏覽 |閱讀模式
 
Push to Facebook

CentOS6系列於2020年11月30號之後停止維護了,故原本的yum源已無法使用,對於我這個從2012年就持續使用CentOS6到現在的忠實粉絲來說實在太可怕了,從來沒有想過這麼大品牌的OpenSource也有在網路上消失的一天,而且還來得這麼快


未更新前使用yum出現的錯誤訊息

  1. [root@test ~]# yum install php
  2. 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參數改為零
  1. [main]
  2. enabled=0
  3. verbose=0
  4. always_print_best_host = true
  5. socket_timeout=3
  6. #  Relative paths are relative to the cachedir (and so works for users as well
  7. # as root).
  8. hostfilepath=timedhosts.txt
  9. maxhostfileage=10
  10. maxthreads=15
  11. #exclude=.gov, facebook
  12. #include_only=.nl,.de,.uk,.ie
複製代碼

或是輸入以下指令快速修改

  1. sed -i "s|enabled=1|enabled=0|g" /etc/yum/pluginconf.d/fastestmirror.conf
複製代碼

備份原本的yum源

  1. [root@test ~]# cd /etc/yum.repos.d
  2. [root@test yum.repos.d]# mv CentOS-Base.repo CentOS-Base.repo-bak
複製代碼

下載官方替代的vault源

  1. curl -o /etc/yum.repos.d/CentOS-Base.repo https://www.xmpan.com/Centos-6-Vault-Official.repo
複製代碼

清除緩存和更新套件資料庫

  1. # yum clean all && yum makecache
複製代碼


國內很多站點都已經刪檔了,我這邊有找到美國加州大學的可用站點 http://mirrors.oit.uci.edu/centos/6.10/os/x86_64/
速度較快,先搶先贏唷!


文章出處

 

臉書網友討論
*滑块验证:
您需要登錄後才可以回帖 登錄 | 註冊 |

本版積分規則



Archiver|手機版|小黑屋|免責聲明|TShopping

GMT+8, 2024-5-13 16:17 , Processed in 0.046271 second(s), 25 queries .

本論壇言論純屬發表者個人意見,與 TShopping綜合論壇 立場無關 如有意見侵犯了您的權益 請寫信聯絡我們。

Powered by Discuz! X3.2

© 2001-2013 Comsenz Inc.

快速回復 返回頂部 返回列表