linux修改yum源映象源
阿新 • • 發佈:2018-12-27
修改CentOS預設yum源為國內yum映象源
1、首先備份系統自帶yum源配置檔案/etc/yum.repos.d/CentOS-Base.repo
1 | [[email protected] ~] # mv /etc/yum.repos.d/CentOS-Base.repo /etc/yum.repos.d/CentOS-Base.repo.backup |
2、進入yum源配置檔案所在的資料夾
1 | [[email protected] ~] # cd /etc/yum.repos.d/ |
3、下載163的yum源配置檔案到上面那個資料夾內
CentOS7
1 | [[email protected] yum.repos.d] # wget http://mirrors.163.com/.help/CentOS7-Base-163.repo |
CentOS6
1 | [[email protected] yum.repos.d] # wget http://mirrors.163.com/.help/CentOS6-Base-163.repo |
CentOS5
1 | [[email protected] yum.repos.d] # wget http://mirrors.163.com/.help/CentOS5-Base-163.repo |
4、執行yum makecache生成快取
1 | [[email protected] yum.repos.d] # yum makecache |
5、這時候再更新系統就會看到以下mirrors.163.com資訊
123456 | [[email protected] yum.repos.d] # yum -y update 已載入外掛:fastestmirror, refresh-packagekit, security 設定更新程序Loading mirror speeds from cached hostfile * base: mirrors.163.com * extras: mirrors.163.com |
1、首先備份系統自帶yum源配置檔案/etc/yum.repos.d/CentOS-Base.repo
1 | [[email protected] ~] # mv /etc/yum.repos.d/CentOS-Base.repo /etc/yum.repos.d/CentOS-Base.repo.backup |
2、下載ailiyun的yum源配置檔案到/etc/yum.repos.d/
CentOS7
1 | [[email protected] ~] # wget -O /etc/yum.repos.d/CentOS-Base.repo http://mirrors.aliyun.com/repo/Centos-7.repo |
CentOS6
1 | [[email protected] ~] # wget -O /etc/yum.repos.d/CentOS-Base.repo http://mirrors.aliyun.com/repo/Centos-6.repo |
CentOS5
1 | [[email protected] ~] # wget -O /etc/yum.repos.d/CentOS-Base.repo http://mirrors.aliyun.com/repo/Centos-5.repo |
3、執行yum makecache生成快取
1 | [[email protected] ~] # yum makecache |
4、這時候再更新系統就會看到以下mirrors.aliyun.com資訊
123456 | [[email protected] ~] # yum -y update 已載入外掛:fastestmirror, refresh-packagekit, security 設定更新程序Loading mirror speeds from cached hostfile * base: mirrors.aliyun.com * extras: mirrors.aliyun.com * updates: mirrors.aliyun.com |
修改CentOS預設yum源為國內yum映象源