centos7配置aliyun的yum源和epel源

一、配置yum的源地址
1、[root@ yum.repos.d]#wget http://mirrors.aliyun.com/repo/Centos-7.repo
centos7配置aliyun的yum源和epel源
2、修改$releasever的值
我們獲取到的配置文件Centos-7.repo打開後有個$releasever,這個是yum變量,我們需要替換掉,否則源沒法使用,如果不替換可以試一下yum的命令查看顯示什麼就知道了。
根據自己系統版本把$releasever替換爲相對應的版本數字。
使用如下命令替換$releasever,
[root@linuxprobe ~]# sed -i 's/$releasever/7/g' /etc/yum.repos.d/Centos-7.repo
3、註釋aliyuncs.com
centos-7.repo文件裏面有的是使用的是https://mirrors.aliyuncs.com.建議都註釋掉,這個地址是用在阿里雲服務器內網的,我們自己的電腦不可能鏈接得到,所以這個我就註釋了。
centos7配置aliyun的yum源和epel源
二、epel源
下載epel源
wget https://mirrors.aliyun.com/repo/epel-7.repo
三、最後執行yum makecache生成緩存。
全部註釋後,再次執行 yum clean all; yum makecache
centos7配置aliyun的yum源和epel源
centos7配置aliyun的yum源和epel源
上面圖片中有幾個沒有啓用,這兩個幹嘛的就留給大家去百度吧,如果想要開啓的話就更改Centos-7.repo文件中的enabled=1就可以了
發表評論
所有評論
還沒有人評論,想成為第一個評論的人麼? 請在上方評論欄輸入並且點擊發布.
相關文章