Software & AppsOperating SystemLinux

How To Uninstall XAMPP on Ubuntu Using Terminal Command

Ubuntu 10

In this article, we’ll guide you through the process of uninstalling XAMPP on an Ubuntu system using the terminal command. XAMPP is a popular open-source web server solution stack that is not always straightforward to remove. We’ll break down the steps and explain what each command does to help you understand the process better.

Quick Answer

To uninstall XAMPP on Ubuntu using the terminal command, open the terminal and navigate to the XAMPP directory using the command cd /opt/lampp. Then, run the uninstallation script with root privileges using the command sudo ./uninstall. Alternatively, you can directly run the uninstallation script with the command sudo /opt/lampp/uninstall.

What is XAMPP?

XAMPP is a free and open-source cross-platform web server solution stack package developed by Apache Friends. It consists of the Apache HTTP Server, MariaDB database, and interpreters for scripts written in the PHP and Perl programming languages.

Why Uninstall XAMPP?

There could be several reasons why you might want to uninstall XAMPP from your system. You may want to free up space, switch to a different server stack, or you might be facing issues with XAMPP that require you to uninstall and reinstall it.

Uninstalling XAMPP Using Terminal Command

Before proceeding, ensure that you have administrative access to your Ubuntu system. The following steps will guide you through the uninstallation process.

Step 1: Open Terminal

You can open the terminal by pressing Ctrl+Alt+T on your keyboard. This is the default shortcut for most Linux distributions.

Step 2: Navigate to the XAMPP Directory

Enter the following command to navigate to the XAMPP directory:

cd /opt/lampp

Here, cd is the command to change the directory, and /opt/lampp is the location of the XAMPP installation.

Step 3: Run the Uninstallation Script

Now, run the uninstallation script with root privileges using the following command:

sudo ./uninstall

In this command, sudo is used to execute the command with root privileges. ./uninstall is the command to run the uninstallation script.

You may be prompted to enter your password. After entering your password, the uninstallation process will begin.

Alternative Method

Alternatively, you can run the uninstallation script directly using the following command:

sudo /opt/lampp/uninstall

This command does the same thing as the two commands above but in a single step.


Uninstalling XAMPP on Ubuntu using the terminal command is a straightforward process if you follow the steps carefully. It’s always important to understand what each command does before executing it. If you encounter any issues during the uninstallation process, ensure that the XAMPP package is not corrupt or incomplete. You may need to redownload the XAMPP package and try again.

Remember, the terminal is a powerful tool in Linux. It allows you to perform complex tasks with just a few commands. However, it should be used with caution, as incorrect commands can cause significant system issues.

Can I uninstall XAMPP without using the terminal command?

Yes, you can uninstall XAMPP using the graphical user interface (GUI) by navigating to the XAMPP installation directory and running the uninstall script. However, using the terminal command is generally faster and more efficient.

Will uninstalling XAMPP delete my database and website files?

Yes, uninstalling XAMPP will remove all files and data associated with the XAMPP installation, including your database and website files. It is essential to back up your files before uninstalling XAMPP to prevent data loss.

How can I back up my database and website files before uninstalling XAMPP?

To back up your database, you can use the mysqldump command to export your database to a file. For website files, you can simply copy the entire XAMPP installation directory to a backup location. Make sure to store the backups in a safe location before proceeding with the uninstallation.

Can I reinstall XAMPP after uninstalling it?

Yes, you can reinstall XAMPP after uninstalling it. Simply download the latest XAMPP package from the Apache Friends website and follow the installation instructions. Keep in mind that reinstalling XAMPP will not restore your previous database and website files unless you have made backups.

How can I check if XAMPP has been successfully uninstalled?

After running the uninstallation script, you can check if XAMPP has been successfully uninstalled by navigating to the XAMPP installation directory and verifying that the files and directories associated with XAMPP have been removed. Additionally, you can check if the XAMPP services are no longer running by using the sudo service --status-all command in the terminal. If XAMPP is no longer listed, it has been successfully uninstalled.

Leave a Comment

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