Linux – How to choose nginx version during rpm install

centos7linuxnginx

According to nginx.org instruction on how to install nginx by .rpm, it says that I should do the following.

open nginx.repo

$ vi /etc/yum.repos.d/nginx.repo

paste the following content in it (for CentOs7)

[nginx]
name=nginx repo
baseurl=http://nginx.org/packages/centos/7/$basearch/
gpgcheck=0
enabled=1

then simply do yum install nginx

This works, but it installs the mainline version and not the stable one. As of now I have 1.8.0

[root@localhost ~]# nginx -v
nginx version: nginx/1.8.0

So, my question is, how do I install the stable version which is currently, at v1.6.3 according to nginx.org

2015-04-07 nginx-1.6.3 stable and nginx-1.7.12 mainline versions have been released.

Best Answer

First, you should take a look at what packages are available

yum --showduplicates list nginx

Looking at that repo, it appears that nginx 1.6.3-1 is the version you want.

You can install the specific version by appending it to the package name with a dash:

yum install nginx-1.6.3-1

That said, nginx 1.8 has been released as stable.

Related Topic