yum國內鏡像配置


yum默認鏈接的還是國外的鏡像,速度相對不理想,配置成國內的鏡像會快很多,這里以阿里鏡像為例進行配置:

CentOS系統更換軟件安裝源

base源
第一步:備份你的原鏡像文件,以免出錯后可以恢復。
mv /etc/yum.repos.d/CentOS-Base.repo /etc/yum.repos.d/CentOS-Base.repo.backup
第二步:下載新的CentOS-Base.repo 到/etc/yum.repos.d/
CentOS 5
wget -O /etc/yum.repos.d/CentOS-Base.repo http://mirrors.aliyun.com/repo/Centos-5.repo
CentOS 6
wget -O /etc/yum.repos.d/CentOS-Base.repo http://mirrors.aliyun.com/repo/Centos-6.repo

CentOS 7
wget -O /etc/yum.repos.d/CentOS-Base.repo http://mirrors.aliyun.com/repo/Centos-7.repo

 

epel源

Epel 5
wget -O /etc/yum.repos.d/epel-5.repo http://mirrors.aliyun.com/repo/Cepel-5.repo
Epel 6
wget -O /etc/yum.repos.d/epel-6.repo http://mirrors.aliyun.com/repo/epel-6.repo

Epel 7
wget -O /etc/yum.repos.d/epel-7.repo http://mirrors.aliyun.com/repo/epel-7.repo


第三步:運行yum makecache生成緩存

yum clean all
yum makecache

--------------------- 本文來自 anigon 的CSDN 博客 ,全文地址請點擊:https://blog.csdn.net/anigon/article/details/54018733?utm_source=copy 


免責聲明!

本站轉載的文章為個人學習借鑒使用,本站對版權不負任何法律責任。如果侵犯了您的隱私權益,請聯系本站郵箱yoyou2525@163.com刪除。



 
粵ICP備18138465號   © 2018-2025 CODEPRJ.COM