Home » Nginx: Uninstall Nginx on Linux – CentOS 7/RHEL 7

Nginx: Uninstall Nginx on Linux – CentOS 7/RHEL 7

by Pring
Nginx: Uninstall Nginx on Linux – CentOS 7/RHEL 7

I. Introduction.

This article describes how to Uninstall Nginx on Linux – CentOS 7/RHEL 7. Nginx is a high performance web server software.

Read other related posts:

II. Prerequisites.

1. Login to your system via SSH. You can use PuTTy tool or Poderosa tool,…
2. Login with root user.  If you are logged in as another user, you will need to add sudo before each command.

III. How to Uninstall Nginx on Linux – CentOS 7/RHEL 7 step by step.

To uninstall Nginx on CentOS 7/RHEL 7 folowing these steps:

Step 1. Remove Nginx Package.
Step 2. Remove Nginx Configure Directory.

You can see details of Video on how to uninstall Nginx on CentOS 7/RHEL 7 as below.
[Sorry, the video we will update later]

Or you also can see details as below.

Step 1. Remove Nginx Package.

The first step is to remove the Nginx package from the CentOS 7 server. Enter the command below:

sudo yum remove nginx

Sample Output:

[root@devopsio ~]# sudo yum remove nginx
Resolving Dependencies
--> Running transaction check
---> Package nginx.x86_64 1:1.12.2-3.el7 will be erased
--> Processing Dependency: nginx for package: 1:nginx-mod-mail-1.12.2-3.el7.x86_64
--> Processing Dependency: nginx for package: 1:nginx-mod-http-image-filter-1.12.2-3.el7.x86_64
--> Processing Dependency: nginx for package: 1:nginx-mod-stream-1.12.2-3.el7.x86_64
--> Processing Dependency: nginx for package: 1:nginx-mod-http-geoip-1.12.2-3.el7.x86_64
--> Processing Dependency: nginx for package: 1:nginx-mod-http-perl-1.12.2-3.el7.x86_64
--> Processing Dependency: nginx for package: 1:nginx-mod-http-xslt-filter-1.12.2-3.el7.x86_64
--> Running transaction check
---> Package nginx-mod-http-geoip.x86_64 1:1.12.2-3.el7 will be erased
--> Processing Dependency: nginx-mod-http-geoip = 1:1.12.2-3.el7 for package: 1:nginx-all-modules-1.12.2-3.el7.noarch
---> Package nginx-mod-http-image-filter.x86_64 1:1.12.2-3.el7 will be erased
---> Package nginx-mod-http-perl.x86_64 1:1.12.2-3.el7 will be erased
---> Package nginx-mod-http-xslt-filter.x86_64 1:1.12.2-3.el7 will be erased
---> Package nginx-mod-mail.x86_64 1:1.12.2-3.el7 will be erased
---> Package nginx-mod-stream.x86_64 1:1.12.2-3.el7 will be erased
--> Running transaction check
---> Package nginx-all-modules.noarch 1:1.12.2-3.el7 will be erased
--> Finished Dependency Resolution

Dependencies Resolved

===============================================================================================
 Package                             Arch           Version                Repository     Size
===============================================================================================
Removing:
 nginx                               x86_64         1:1.12.2-3.el7         @epel         1.5 M
Removing for dependencies:
 nginx-all-modules                   noarch         1:1.12.2-3.el7         @epel         0.0  
 nginx-mod-http-geoip                x86_64         1:1.12.2-3.el7         @epel          21 k
 nginx-mod-http-image-filter         x86_64         1:1.12.2-3.el7         @epel          24 k
 nginx-mod-http-perl                 x86_64         1:1.12.2-3.el7         @epel          54 k
 nginx-mod-http-xslt-filter          x86_64         1:1.12.2-3.el7         @epel          24 k
 nginx-mod-mail                      x86_64         1:1.12.2-3.el7         @epel          99 k
 nginx-mod-stream                    x86_64         1:1.12.2-3.el7         @epel         157 k

Transaction Summary
===============================================================================================
Remove  1 Package (+7 Dependent packages)

Installed size: 1.9 M
Is this ok [y/N]: y
Downloading packages:
Running transaction check
Running transaction test
Transaction test succeeded
Running transaction
  Erasing    : 1:nginx-mod-http-geoip-1.12.2-3.el7.x86_64                                  1/8 
  Erasing    : 1:nginx-mod-http-image-filter-1.12.2-3.el7.x86_64                           2/8 
  Erasing    : 1:nginx-mod-http-xslt-filter-1.12.2-3.el7.x86_64                            3/8 
  Erasing    : 1:nginx-mod-mail-1.12.2-3.el7.x86_64                                        4/8 
  Erasing    : 1:nginx-mod-stream-1.12.2-3.el7.x86_64                                      5/8 
  Erasing    : 1:nginx-all-modules-1.12.2-3.el7.noarch                                     6/8 
  Erasing    : 1:nginx-mod-http-perl-1.12.2-3.el7.x86_64                                   7/8 
  Erasing    : 1:nginx-1.12.2-3.el7.x86_64                                                 8/8 
warning: /etc/nginx/nginx.conf saved as /etc/nginx/nginx.conf.rpmsave
  Verifying  : 1:nginx-mod-http-perl-1.12.2-3.el7.x86_64                                   1/8 
  Verifying  : 1:nginx-mod-http-xslt-filter-1.12.2-3.el7.x86_64                            2/8 
  Verifying  : 1:nginx-all-modules-1.12.2-3.el7.noarch                                     3/8 
  Verifying  : 1:nginx-mod-http-image-filter-1.12.2-3.el7.x86_64                           4/8 
  Verifying  : 1:nginx-1.12.2-3.el7.x86_64                                                 5/8 
  Verifying  : 1:nginx-mod-mail-1.12.2-3.el7.x86_64                                        6/8 
  Verifying  : 1:nginx-mod-stream-1.12.2-3.el7.x86_64                                      7/8 
  Verifying  : 1:nginx-mod-http-geoip-1.12.2-3.el7.x86_64                                  8/8 

Removed:
  nginx.x86_64 1:1.12.2-3.el7                                                                  

Dependency Removed:
  nginx-all-modules.noarch 1:1.12.2-3.el7           nginx-mod-http-geoip.x86_64 1:1.12.2-3.el7
  nginx-mod-http-image-filter.x86_64 1:1.12.2-3.el7 nginx-mod-http-perl.x86_64 1:1.12.2-3.el7 
  nginx-mod-http-xslt-filter.x86_64 1:1.12.2-3.el7  nginx-mod-mail.x86_64 1:1.12.2-3.el7      
  nginx-mod-stream.x86_64 1:1.12.2-3.el7           

Complete!

Step 2. Remove Nginx Configure Directory.

The next step is remove nginx data directory. By default Nginx configure directory path is /etc/nginx/. And log directory path is /var/log/nginx/
Enter the command below.

sudo rm -R /etc/nginx
sudo rm -R /var/log/nginx

IV. Conclusion.

In this tutorial, we was uninstall Nginx on CentOS 7/RHEL 7 server. If you hit a problem or have feedback, leave a comment below.


Uninstall Nginx on CentOS 7/RHEL 7 is complete. Wish you success and luck.
Thanks and best regards!
— Pring —

Related Articles

3 comments

vurtilopmer December 9, 2019 - 7:49 pm

Just wanna input on few general things, The website style is perfect, the content material is real great : D.

Reply
Joesph March 30, 2020 - 11:47 pm

Oh my goodness! Incredible article dude! Many thanks, However I am having problems
with your RSS. I don’t know the reason why I can’t join it.
Is there anybody else having similar RSS problems? Anybody who knows
the solution will you kindly respond? Thanx!!

Reply
türkçe izle December 10, 2020 - 12:34 am

Hi to all, how is all, I think every one is getting more from this web page, and your views are good designed for new visitors. Eileen Tallie Delwin

Reply

Leave a Comment