Home > Article > Backend Development > Use apt method to install and uninstall nginx under ubuntu
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.
<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>
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.