1. 程式人生 > 其它 >linux安裝配置阿里雲的yum源

linux安裝配置阿里雲的yum源

 

一.yum源理解

yum源倉庫的地址 在/etc/yum.repos.d/,並且只能讀出第一層的repo檔案
yum倉庫的檔案都是以.repo結尾的

二.下載阿里雲的.repo倉庫檔案 ,放到/etc/yum.repos.d/

備份原本的倉庫檔案

cd /etc/yum.repos.d/ 
mkdir allbak 
mv ./* allbak 
#此時 /etc/yum.repos.d/底下就沒有repo檔案,此時無法使用yum工具,必須配置yum源,生成新的.repo檔案

1.下載第一個阿里雲倉庫檔案
wget -O /etc/yum.repos.d/CentOS-Base.repo http://mirrors.aliyun.com/repo/Centos-7.repo
-O 引數 ,指定一個下載地址,且改名
2.配置第二個倉庫檔案 epel 額外倉庫(redis,nginx,mongo,ipython)
wget -O /etc/yum.repos.d/epel.repo http://mirrors.aliyun.com/repo/epel-7.repo

3.清空原本yum快取
yum clean all
4.生成新的阿里雲的yum快取,加速下載預熱資料
yum makecache

一.yum源理解

yum源倉庫的地址 在/etc/yum.repos.d/,並且只能讀出第一層的repo檔案
yum倉庫的檔案都是以.repo結尾的

二.下載阿里雲的.repo倉庫檔案 ,放到/etc/yum.repos.d/

備份原本的倉庫檔案

cd /etc/yum.repos.d/ 
mkdir allbak 
mv ./* allbak 
#此時 /etc/yum.repos.d/底下就沒有repo檔案,此時無法使用yum工具,必須配置yum源,生成新的.repo檔案

1.下載第一個阿里雲倉庫檔案
wget -O /etc/yum.repos.d/CentOS-Base.repo http://mirrors.aliyun.com/repo/Centos-7.repo
-O 引數 ,指定一個下載地址,且改名
2.配置第二個倉庫檔案 epel 額外倉庫(redis,nginx,mongo,ipython)
wget -O /etc/yum.repos.d/epel.repo http://mirrors.aliyun.com/repo/epel-7.repo

3.清空原本yum快取
yum clean all
4.生成新的阿里雲的yum快取,加速下載預熱資料
yum makecache