使用官方源
http://mirrors.aliyun.com/
http://mirrors.163.com
==基础源==
Base/Extras/Updates: 默认(国外源)
[root@tianyun ~]# ls /etc/yum.repos.d/
CentOS-Base.repo CentOS-fasttrack.repo CentOS-Vault.repo
CentOS-CR.repo CentOS-Media.repo
CentOS-Debuginfo.repo CentOS-Sources.repo
[root@tianyun ~]# yum repolist
repo id repo name status
base/7/x86_64 CentOS-7 - Base 9,363
extras/7/x86_64 CentOS-7 - Extras 449
updates/7/x86_64 CentOS-7 - Updates 2,146
repolist: 11,958
/etc/yum.repos.d/
aliyun:
[root@tianyun ~]# mv /etc/yum.repos.d/CentOS-Base.repo /etc/yum.repos.d/CentOS-Base.repo.backup
[root@tianyun ~]# curl -o /etc/yum.repos.d/CentOS-Base.repo http://mirrors.aliyun.com/repo/Centos-7.repo
[root@tianyun ~]# yum clean all // 清除原来旧的YUM 数据库信息
[root@tianyun ~]# yum makecache // 更新新的YUM仓库信息
yum -y install lftp
163:
[root@tianyun ~]# mv /etc/yum.repos.d/CentOS-Base.repo /etc/yum.repos.d/CentOS-Base.repo.backup
[root@tianyun ~]# curl -o /etc/yum.repos.d/CentOS-Base.repo http://mirrors.163.com/.help/CentOS7-Base-163.repo
** EPEL:**
[root@tianyun ~]# yum -y install epel-release (国外源)
或
[root@tianyun ~]# mv /etc/yum.repos.d/epel.repo /etc/yum.repos.d/epel.repo.backup
[root@tianyun ~]# wget -O /etc/yum.repos.d/epel.repo http://mirrors.aliyun.com/repo/epel-7.repo
==软件官方源==
Nginx:
nginx.org
[root@tianyun ~]# vim /etc/yum.repos.d/nginx.repo
[nginx]
name=nginx repo
baseurl=http://nginx.org/packages/centos/7/$basearch/
gpgcheck=0
enabled=1
MySQL:
yum -y install https://dev.mysql.com/get/mysql57-community-release-el7-9.noarch.rpm
Zabbix:
# rpm -ivh http://repo.zabbix.com/zabbix/3.2/rhel/7/x86_64/zabbix-release-3.2-1.el7.noarch.rpm
**