目錄
- 1. 官方地址
- 2. 社區檔案
- 3. 鏡像更換
- 3.1 配置方法:
- 3.1.1. 備份原組態檔
- 3.1.2. 下載新的 CentOS-Base.repo 到 /etc/yum.repos.d/
- 3.1.3. 生成快取
- 3.2 其它說明
- 3.1 配置方法:
1. 官方地址
https://developer.aliyun.com/mirror/?spm=5176.10695662.1173276.2.13d534f6WcJKj0
2. 社區檔案
https://developer.aliyun.com/mirror/centos?spm=a2c6h.13651102.0.0.7f8b1b11YXMapq
3. 鏡像更換
CentOS鏡像 簡介
CentOS,是基于 Red Hat Linux 提供的可自由使用源代碼的企業級 Linux 發行版本;是一個穩定,可預測,可管理和可復制的免費企業級計算平臺,
3.1 配置方法:
3.1.1. 備份原組態檔
mv /etc/yum.repos.d/CentOS-Base.repo /etc/yum.repos.d/CentOS-Base.repo.backup
3.1.2. 下載新的 CentOS-Base.repo 到 /etc/yum.repos.d/
CentOS 6
wget -O /etc/yum.repos.d/CentOS-Base.repo https://mirrors.aliyun.com/repo/Centos-6.repo
或者
curl -o /etc/yum.repos.d/CentOS-Base.repo https://mirrors.aliyun.com/repo/Centos-6.repo
CentOS 7
wget -O /etc/yum.repos.d/CentOS-Base.repo https://mirrors.aliyun.com/repo/Centos-7.repo
或者
curl -o /etc/yum.repos.d/CentOS-Base.repo https://mirrors.aliyun.com/repo/Centos-7.repo
CentOS 8
wget -O /etc/yum.repos.d/CentOS-Base.repo https://mirrors.aliyun.com/repo/Centos-8.repo
或者
curl -o /etc/yum.repos.d/CentOS-Base.repo https://mirrors.aliyun.com/repo/Centos-8.repo
3.1.3. 生成快取
yum makecache
3.2 其它說明
非阿里云ECS用戶會出現 Couldn't resolve host 'mirrors.cloud.aliyuncs.com' 資訊,不影響使用,用戶也可自行修改相關配置: eg:
sed -i -e '/mirrors.cloud.aliyuncs.com/d' -e '/mirrors.aliyuncs.com/d' /etc/yum.repos.d/CentOS-Base.repo
轉載請註明出處,本文鏈接:https://www.uj5u.com/caozuo/278332.html
標籤:Linux
上一篇:shell 正則運算式 疑問,哪位大神給看下 如何解決
下一篇:非常實用的 Shell 腳本
