vi /etc/yum.repos.d/nginx.repo
[nginx-stable] name=nginx stable repo baseurl=http://nginx.org/packages/centos/$releasever/$basearch/ gpgcheck=1 enabled=1 gpgkey=https://nginx.org/keys/nginx_signing.key [nginx-mainline] name=nginx mainline repo baseurl=http://nginx.org/packages/mainline/centos/$releasever/$basearch/ gpgcheck=1 enabled=0 gpgkey=https://nginx.org/keys/nginx_signing.key
通过yum search nginx看看是否已经添加源成功。如果成功则执行下列命令安装nginx。
yum install -y nginx-1.16.1
标签:1.16,mainline,repo,nginx,yum,版本,org From: https://www.cnblogs.com/testzcy/p/17583269.html