vi /etc/yum.repo.d/nginx.repo
[nginx-stable] name=nginx stable repo baseurl=http://nginx.org/packages/centos/7/$basearch/ gpgcheck=1 enabled=1 gpgkey=https://nginx.org/keys/nginx_signing.key module_hotfixes=true
会先去找http://nginx.org/packages/centos/7/x86_64/repodata/repomd.xml文件
查看repos源yum repolist
是否添加了nginx-stable
罗列nginx版本yum list | grep nginx
或者指定源yum list --enablerepo=nginx-stable | grep nginx
安装指定版本
yum install nginx-1.22.0
卸载使用yum remove方式