How To Uninstall LAMP in Ubuntu 9.10 Karmic Koala
The most popular post on this blog is How to Install LAMP on Ubuntu 9.10. On that post, I've had a few comments asking how to remove the single command LAMP installation. Perhaps the something went wrong during the installation and you want to completely remove everything and start over. Or maybe you just decided you don't need it installed any more and don't want the extra files and processes cluttering up your system. For whatever reason, due to popular demand...
How To Uninstall LAMP in Ubuntu 9.10
Actually, I'm only going to show how to remove AMP, since I assume you want to keep the GNU/Linux part of your installation. It would be nice if the removal could be done with a single command like:
DO NOT DO THAT!!
That command appears to remove most, if not all, of your Ubuntu Desktop system. So instead, let's work backwards to remove the AMP part.
Remove phpMyAdmin
The phpMyAdmin installation was the last part of my LAMP installation tutorial, so we'll remove that first. From the command line:
You'll be presented with a screen asking if you want to deconfigure the database for phpMyAdmin.
Go ahead and select Yes and hit <Enter>.
You'll be asked next if you want to purge the database for phpMyAdmin.
Again, select Yes and hit <Enter>.
The next screen is a little confusing. It prompts for the database administrator password, but it gives the impression that it's installing a new database.
Enter the correct password, (you created the password when you installed phpMyAdmin), select Ok and hit <Enter>. The phpMyAdmin removal should now complete.
Remove MySQL
Now let's see if we can remove MySQL. First we'll see what packages are installed relative to MySQL. Go to your terminal and enter:
My system gives this list of packages.
mysql-server-5.1
mysql-server-core-5.1
php5-mysql
So let's get rid of those.
You have successfully removed MySQL Server from your system.
Remove Apache
First, we'll use a similar command like in the previous step to check what Apache packages are installed.
My results look like this:
apache2-mpm-prefork
apache2-utils
apache2.2-bin
apache2.2-common
libapache2-mod-php5
So let's remove those.
Apache should be gone from your system.
Cleaning up
There may be a few stray packages left on your system that you no longer need. Get rid of them with:
You're now ready to reinstall your LAMP server if that's what you want to do.





Story added...
This story has been submitted to fsdaily.com! If you think this story should be read by the free software community, come vote it up and discuss it here.
Thank's, that's so good...
wow thank you!
Great... I appreciate it..........
Perfect just what i was looking for spen ages search around because i didnt get it installed properly and needed to redo it all.
Was thinking about installing ubuntu again but you saved my day!
[...] How To Uninstall LAMP in Ubuntu 9.10 Karmic Koala [...]
"You're now ready to reinstall your LAMP server if that's what you want to do."
This made me laugh! Thanks! And yes, I want to reinstall server, but its XAMPP this time.
THANX A LOT MAN... thanx for helping out!