下面由Centos使用教程欄目給大家介紹用阿里源替換原Centos的yum源的方法,希望對(duì)需要的朋友有所幫助!
簡(jiǎn)單的了解幾個(gè)開源站
如果需要下載一些鏡像文件,例如CentOS或者Ubuntu等等之類的開源軟件,可以再國(guó)內(nèi)通過下面幾個(gè)鏡像站點(diǎn)來獲取。
阿里的開源鏡像站(https://opsx.alibaba.com/)
網(wǎng)易開源鏡像站(http://mirrors.163.com/)
清華大學(xué)開源鏡像站(https://mirrors.tuna.tsinghua.edu.cn/)
進(jìn)入正題
1.備份
[root@localhost ~]# mv /etc/yum.repos.d/CentOS-Base.repo /etc/yum.repos.d/CentOS-Base.repo.backup
2.下載新的CentOS-Base.repo 到 /etc/yum.repos.d/下
CentOS 5 [root@localhost ~]# wget -O /etc/yum.repos.d/CentOS-Base.repo http://mirrors.aliyun.com/repo/Centos-5.repo CentOS 6 [root@localhost ~]# wget -O /etc/yum.repos.d/CentOS-Base.repo http://mirrors.aliyun.com/repo/Centos-6.repo CentOS 7 [root@localhost ~]# wget -O /etc/yum.repos.d/CentOS-Base.repo http://mirrors.aliyun.com/repo/Centos-7.repo
3.運(yùn)行yum makecache生成緩存
[root@localhost ~]# yum clean all [root@localhost ~]# yum makecache [root@localhost ~]# yum update
這里解釋下yum makecache:就是把服務(wù)器的包信息下載到本地電腦緩存起來。