How to Remove Apache from Ubuntu 18.04 | 20.04

How to Remove Apache from Ubuntu 18.04 20.04

In this article, we are going to shows that How to remove or purge Apache web server from Ubuntu 18.04 | 20.04.

Apache is a free, open-source and cross-platform web HTTP server that is used to delivers web content through the internet.

If you want to remove Apache web server from your Ubuntu systems then there are two methods to uninstall or remove installed programs from Ubuntu and Linux systems:

  1. Run the apt with remove option
  2. Run the apt with purge option

Ubuntu is a Linux Operating System based on Debian and mostly composed of non-profit(free) and open-source software. It is a complete Linux operating system that compatible with desktops, laptops, server and other devices. Ubuntu is Open Source so it is freely available for both community and professional support.

If you are a learner and looking for a Linux distribution for Learning then Ubuntu Linux Operating System is best for you as a beginning.

Please follow below methods to remove Apache from Ubuntu System :

Prerequisites

  • System with Apache server installed and configured
  • Access to command line
  • A user account with sudo or root privileges

Method 1 : Remove Apache

if you run the apt with remove option then it will delete Apache web server package from the host system and keep all configuration file of Apache.

Run the below command, if you want to remove Apache server package and want to keep all configuration files:

sudo apt remove apache2

When you run the above command, it will delete the Apache server packages and keep all configuration files and content directory of Apache.

Site configuration file located at /etc/apache2 directory and content directory located at /var/www.


Method 2 : Purge Apache

if you run the apt with purge option then it will delete Apache web server packages and all its configuration files from Ubuntu system.

Run the below command to completely delete Apache server along with the its configuration files and settings:

sudo apt purge apache2

Reinstall Apache

if you run the apt with reinstall option then it will delete Apache web server and install it again.

To do that, simply run the below commands:

sudo apt reinstall apache2

That’s all.

If you face any error and issue in above steps , please use comment box below to report.


Leave a Comment

Your email address will not be published. Required fields are marked *

This site uses Akismet to reduce spam. Learn how your comment data is processed.

Scroll to Top