centos 各版本安装nginx源,yum 一键装

# 查看支持的nginx 版本
rpm -aq | grep nginx 
# 安装 nginx 
yum install nginx

解决epel源没有nginx源的问题
查询nginx 支持的系统 https://nginx.org/packages/centos
各类系统支持查看 https://nginx.org/packages

# 把源内容填入
vim /etc/yum.repos.d/nginx.repo

centos6

[nginx]
name=nginx repo
baseurl=https://nginx.org/packages/centos/6/x86_64/
gpgcheck=0
enabled=1

centos7

[nginx]
name=nginx repo
baseurl=https://nginx.org/packages/centos/7/x86_64/
gpgcheck=0
enabled=1

centos8

[nginx]
name=nginx repo
baseurl=https://nginx.org/packages/centos/8/x86_64/
gpgcheck=0
enabled=1
posted @ 2021-04-19 12:13  运维之爪  阅读(299)  评论(0编辑  收藏  举报