I have a problem on an ubuntu 16.04 server that I set up. I suspected that I had made a number of errors when I installed and configured apache2 originally because it was not behaving the way it normally does.
I decided to uninstall apache2 completely, including removing the config files, so that I could do a "fresh" installation.
I ran these commands:- service apache2 stop sudo apt-get purge apache2 apache2-utils apache2.2-bin apache2-common sudo apt-get autoremove --purge whereis apache2 rm -Rf /etc/apache2 /usr/lib/apache2 /usr/include/apache2
After the above, I did another whereis and decided to remove more stuff rm -Rf /usr/sbin/apache2 /usr/share/apache2 /usr/share/man/man8/apache2.8.gz
Then everything was gone!
I rebooted the server.
However, when I now say: apt install apache2
Reading package lists... Done
Building dependency tree
Reading state information... Done
apache2 is already the newest version (2.4.18-2ubuntu3.9).
0 upgraded, 0 newly installed, 0 to remove and 2 not upgraded.
But I checked and /etc/apache2, etc is gone. It is as if it is telling me apache2 is still there?
I'm confused! Help!
Procedure. To uninstall Apache as a service, open a Command Prompt window. Navigate to the default Apache installation directory, for example, C:\Program Files\Apache Group\Apache or wherever apache.exe is located. At the command prompt, type apache -u.
Follow these steps to remove the apache2
service using Terminal
:
sudo service apache2 stop
Now remove and cleanup all the apache2 packages with:
sudo apt-get purge apache2 apache2-utils apache2.2-bin apache2-common
//or
sudo apt-get purge apache2 apache2-utils apache2-bin apache2.2-common
Finally, run sudo apt-get autoremove
just in case any other cleanup in needed
You can do the following two tests to confirm apache has been removed:
which apache2
- should return a blank linesudo service apache2 start
- should return apache2: unrecognized service
answer from here
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With