How To Uninstall LAMP in Ubuntu 9.10 Karmic Koala
Update: I've written a simpler procedure that will uninstall LAMP with a single command. I'm leaving this post here for historical reasons, but the process is much faster if you follow my newer post.
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 ENTER THE FOLLOWING COMMAND!!
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.






Hey,
its so good, very very useful. it worked for me.
Thank You.
idem
Hey,
its so good, very very useful. it worked for me.
Thank You.
Thank you for saving me a huge amount of time
This is very helpful! Thanks a lot!
This is very useful.At last i find coorect solution of my problem thanks lot.
Awesome, thanks a lot!
This commands very useful to me thx
Very useful!
Good
thnak you..
thanks.. it is very usefull for me.
Mahalo very helpful blog!
That was fantastic. Thanx
Thank you so much. It worked for me clearly.
Thanks for sharing ! Gracias !
very useful and informative - Thank you
awesome this is the best tutorial that I got...
thanks dude, two thumbs up for you!!!!
Thank you!
worked perfectly !
It works!! very nice
Brilliant! Worked flawlessly. Thanks!
thanks!!!!!!alot