下載配置文件,加入/etc/yum.repos.d/
阿里鏡像:
http://mirrors.aliyun.com/repo/Centos-7.repo
網易鏡像:
http://mirrors.163.com/.help/CentOS7-Base-163.repo
如果有本地源鏡像,修改以上配置文件的地址
[root@VM_58_118_centos yum.repos.d]# pwd /etc/yum.repos.d [root@VM_58_118_centos yum.repos.d]# ll 總用量 68 -rw-r--r-- 1 root root 2006 9月 18 2014 CentOS-Base.repo -rw-r--r-- 1 root root 1410 3月 11 2016 CentOS-Base.repo.backup -rw-r--r-- 1 root root 1309 12月 9 2015 CentOS-CR.repo -rw-r--r-- 1 root root 649 12月 9 2015 CentOS-Debuginfo.repo -rw-r--r-- 1 root root 220 3月 11 2016 CentOS-Epel.repo -rw-r--r-- 1 root root 290 12月 9 2015 CentOS-fasttrack.repo -rw-r--r-- 1 root root 630 12月 9 2015 CentOS-Media.repo -rw-r--r-- 1 root root 1331 12月 9 2015 CentOS-Sources.repo -rw-r--r-- 1 root root 1952 12月 9 2015 CentOS-Vault.repo -rw-r--r-- 1 root root 957 11月 26 2014 epel.repo -rw-r--r-- 1 root root 1056 11月 26 2014 epel-testing.repo -rw-r--r-- 1 root root 1209 3月 11 2016 mysql-community.repo -rw-r--r-- 1 root root 1060 1月 29 2014 mysql-community-source.repo -rw-r--r-- 1 root root 109 9月 16 20:12 nginx.repo -rw-r--r-- 1 root root 1177 12月 9 2015 remi-php70.repo -rw-r--r-- 1 root root 2340 12月 9 2015 remi.repo -rw-r--r-- 1 root root 449 12月 9 2015 remi-safe.repo [root@VM_58_118_centos yum.repos.d]# cat nginx.repo [nginx] name=nginx repo baseurl=http://nginx.org/packages/mainline/centos/7/$basearch/ gpgcheck=0 enabled=1
