一、阿里云yum源
[base] | 容器名称,一定要放在[]中 |
---|---|
name | 容器说明,可以自己随便写 |
mirrorlist | 镜像站点,这个可以注释掉 |
baseurl | 我们的源服务器的地址。默认是Cent0S官方的yum源服务器,是可以使用的,如果你觉得慢可以改成你喜欢的yum源地址 |
enabled | 此容器是否生效,如果不写或写成enable一1都是生效,写成enable=0就是不生效 |
gpgcheck | 如果是1是指RPM的数字证书生效,如果是0则不生效 |
gpgkey | 数字证书的公钥文件保存位置。不用修改 |
- 在阿里镜像站点下载对应的客户端仓库配置文件
wget http://mirrors.aliyun.com/repo/Centos-7.repo
- 将下载到的客户端仓库配置文件移动到/etc/yum.repos.d目录
mv Centos-6.repo /etc/yum.repos.d
cd /etc/yum.repos.d mv local.repo /root
- 安装程序进行验证结果
yum -y install nginx
- 各版本配置列表
- CentOS 8
curl -o /etc/yum.repos.d/CentOS-Base.repo http://mirrors.aliyun.com/repo/Centos-8.repo
- CentOS7
curl -o /etc/yum.repos.d/CentOS-Base.repo http://mirrors.aliyun.com/repo/Centos-7.repo
- CentOS6
curl -o /etc/yum.repos.d/CentOS-Base.repo http://mirrors.aliyun.com/repo/Centos-6.repo
- 安装epel源
yum -y install epel-release 出现3个.repo文件即可
二、腾讯源
- yum源
- CentOS6
curl -o /etc/yum.repos.d/CentOS-Base.repo http://mirrors.cloud.tencent.com/repo/centos6_base.repo
- CentOS7
curl -o /etc/yum.repos.d/CentOS-Base.repo http://mirrors.cloud.tencent.com/repo/centos7_base.repo
- CentOS8
curl -o /etc/yum.repos.d/CentOS-Base.repo http://mirrors.cloud.tencent.com/repo/centos8_base.repo
- epel源
- epel(RHEL6系列)
curl -o /etc/yum.repos.d/epel.repo http://mirrors.cloud.tencent.com/repo/epel-6.repo
- epel(RHEL7系列)
curl -o /etc/yum.repos.d/epel.repo http://mirrors.cloud.tencent.com/repo/epel-7.repo
- epel(RHEL8系列)
curl -o /etc/yum.repos.d/epel.repo http://mirrors.cloud.tencent.com/repo/epel-8.repo