Cannot remove NGINX

1,499

Solution 1

nginx is a metapackage, so you need to remove whatever was installed by this package. If doing sudo apt-get autoremove doesn't do the trick, you can run sudo apt-get remove nginx-core nginx-full nginx-light nginx-extras nginx-naxsi nginx-common (you probably have only one of these packages installed, but the command shouldn't fail).

Solution 2

sudo apt-get remove --purge nginx* will remove whatever is installed and is related to nginx, including configuration files. It will also list packages available in repositories which match the regex nginx* and are not installed.

There is a difference between apt-get remove and apt-get purge. The --purge option removes also the configuration files. It is useful for a clean reinstall.

Typing the command:

sudo apt-get remove --purge nginx*

will result in:

The following packages will be REMOVED:
nginx-common*
0 upgraded, 0 newly installed, 1 to remove and 0 not upgraded.
After this operation, 0 B of additional disk space will be used.
Do you want to continue [Y/n]? 
(Reading database ... 55416 files and directories currently installed.)
Removing nginx-common ...
Purging configuration files for nginx-common ...
Share:
1,499

Related videos on Youtube

march_seven
Author by

march_seven

Updated on September 18, 2022

Comments

  • march_seven
    march_seven almost 2 years

    there are several different format files in the Documents

    I need to get a string which is the *xlsx format files path I using below code ,but it return a error as like below

    PATH= u'F:\Workfiles\周报\\forupdate'
    filepath = os.path.join(PATH,str(os.listdir(PATH)))
    

    IOError: [Errno 2] No such file or directory: u"F:\Workfiles\\u5468\u62a5\forupdate\[u'suxl20170821.xlsx']"

    does any body knows how to get the files path ???

    • Mendhak
      Mendhak about 10 years
      Did you try sudo apt-get purge nginx? You can try reinstalling it, then purging it.
    • arty
      arty about 10 years
      I tried reinstalling and purging. Its still there :(
  • saiarcot895
    saiarcot895 about 10 years
    I typically go by the size of the package. If the Installed-Size of the package (apt-cache show nginx, or apt-cache show ubuntu-desktop) is less than 100, then there's a good chance that it's just a metapackage, and to look at the dependencies (which may point to a specific version or variant of the software). Also, packages that are in the metapackages section are certain to be metapackages; however, not all metapackages are in the metapackages section.
  • m3nda
    m3nda about 9 years
    The most possible ones would be nginx-core & nginx-common. Thank you.
  • march_seven
    march_seven almost 7 years
    thanks method 1 is OK ,but method 2 seems os.chdir() have not work, it means os have not change into the directory~~~