1、安裝基本工具 wget
[root@localhost ~]# yum install -y wget
2、進(jìn)入存放 yum 源配置的目錄
[root@localhost ~]# cd /etc/yum.repos.d/
3、創(chuàng)建目錄,用來存放系統(tǒng)自帶的 yum 源配置文件
[root@localhost yum.repos.d]# mkdir backup
4、對系統(tǒng)初始默認(rèn)源配置文件進(jìn)行備份
[root@localhost yum.repos.d]# mv C* backup/
5、下載阿里云yum源
[root@localhost yum.repos.d]# wget -O /etc/yum.repos.d/CenOS-Base.repo https://mirrors.aliyun.com/repo/centos-7.repo
6、清除舊緩存
[root@localhost ~]# yum clean all
Loaded plugins: fastestmirror
Cleaning repos: base extras updates
Cleaning up list of fastest mirrors
7、創(chuàng)建新緩存
[root@localhost ~]# yum makecache
8、安裝必要的軟件包
[root@localhost ~]# yum -y install vim tree nmap sysstat gcc gcc-c++ make telnet
至此,Centos 7 設(shè)置使用阿里云鏡像做 yum 源完畢!