系统相关
首页 > 系统相关> > nginx通过yum安装指定版本

nginx通过yum安装指定版本

作者:互联网

  1. 创建repo文件 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文件

  1. 查看repos源yum repolist是否添加了nginx-stable
    image

  2. 罗列nginx版本yum list | grep nginx
    或者指定源yum list --enablerepo=nginx-stable | grep nginx
    image

  3. 安装指定版本
    yum install nginx-1.22.0

  4. 卸载使用yum remove方式

标签:centos,repo,nginx,yum,版本,stable,org
来源: https://www.cnblogs.com/TheoryDance/p/16452007.html