Home  >  Article  >  Backend Development  >  Use apt method to install and uninstall nginx under ubuntu

Use apt method to install and uninstall nginx under ubuntu

WBOY
WBOYOriginal
2016-07-28 08:27:111266browse

The apt method of installing software under ubuntu and debain is very convenient, especially for novices to install and uninstall nginx.
Since nginx cannot add modules dynamically, it will be frequently installed, uninstalled, and upgraded.

  • apt install nginx method
<code>sudo apt<span>-add</span><span>-repository</span> ppa:nginx/development
sudo apt<span>-get</span> update
sudo apt<span>-get</span> install nginx</code>
  • apt uninstall nginx method

uninstall method 1.
Delete nginx, keep the configuration file

<code><span>sudo</span> apt-get remove nginx</code>

Delete the configuration file

<code>rm <span>-rf</span> /etc/nginx</code>

Uninstall method 2.
Delete nginx associated configuration files

<code><span>sudo</span> apt-get purge nginx <span># Removes everything.</span></code>

Uninstall nginx dependent programs that are no longer needed

<code><span>sudo</span> apt-get autoremove</code>
').addClass('pre-numbering').hide(); $(this).addClass('has-numbering').parent().append($numbering); for (i = 1; i ').text(i)); }; $numbering.fadeIn(1700); }); });

The above introduces the use of apt method to install and uninstall nginx under ubuntu, including the relevant content. I hope it will be helpful to friends who are interested in PHP tutorials.

Statement:
The content of this article is voluntarily contributed by netizens, and the copyright belongs to the original author. This site does not assume corresponding legal responsibility. If you find any content suspected of plagiarism or infringement, please contact admin@php.cn