Sponsors
Tags
Apache Apple audio avast bash Chromium command line dell Distro Review fedora firefox flac gadgets gnome google google chrome grub GStreamer HowTo HP humor ImageMagick jaunty karmic koala LAMP linux Linux Mint Lucid Lynx mp3 Nautilus netbook network news ogg open source opinion phpMyAdmin review security text edit Ubuntu usb web development windows WordPress
Remove LAMP in Ubuntu
The most popular post on this site is the one showing how to install a LAMP server on Ubuntu. Once you're done developing your websites on your computer, you may want to remove the LAMP server from your Ubuntu installation. Actually, you probably want to leave the Linux part and only remove the AMP part, (Apache, MySQL, php).
I've done a post previously that shows how to do this in several steps, but I wanted to come up with a more automated way. So I came up with this one-liner that will remove Apache, MySQL, php, and phpMyAdmin from your Ubuntu system.
Warning: this command will uninstall the packages from your system without asking for confirmation.
If you're a bit unsure about doing this and you only want to see a list of packages that will be removed, just leave off the end portion from the last pipe onward, like this.
Tags: HowTo, LAMP, linux, Ubuntu, web development
Comments
13 Responses to “Remove LAMP in Ubuntu”
Leave a Reply Cancel reply
Subscribe by email
Top Content
- 6 Things To Do After Installing Ubuntu 13.04
- How To Control Fan Speeds in Ubuntu
- Remove Old Kernels In Ubuntu With One Command
- Distro Review: Xubuntu 13.04 Raring Ringtail
- Send Gmail from the Linux Command Line
- How To Rotate The Screen in Ubuntu With The Nvidia Driver
- How to Configure Apache Web Server on Linux
- Install SSH and SFTP on Ubuntu or Linux Mint
- Fade Out Images with GIMP
- Review: Linux Mint 14 MATE Edition
Categories
-
Archives
- ▼ 2013 (7)
- ► 2012 (19)
- ► 2011 (25)
- ► 2010 (56)
- ► Dec (4)
- ► Nov (3)
- ► Oct (4)
- ► Sep (4)
- ► Aug (3)
- ► Jul (5)
- ► Jun (4)
- ► May (8)
-
- How To Rotate The Screen in Ubuntu With The Nvidia Driver
- Lynx: A Text Only Web Browser
- Midori - A Lightweight Web Browser
- From The "WTF, Apple?" Dept.
- There's Always One Bad Apple
- Ubuntu on "The Big Bang Theory"
- Organize Your Recipes with Gourmet Recipe Manager
- Add an Open Terminal Button to Nautilus
- ► Apr (6)
- ► Mar (5)
- ► Feb (3)
- ► Jan (7)
- ► 2009 (88)
- ► Dec (4)
- ► Nov (5)
- ► Oct (7)
- ► Sep (6)
- ► Aug (13)
-
- Enable The RT2860STA Linux Wireless Driver
- Fade Out Images with GIMP
- Command Line Basics: Redirecting Output
- Command Line Basics: View Files With cat
- Command Line Basics: Determine File MIME Types
- Batch Watermark Images in Linux
- How To Watermark Images With ImageMagick in Linux
- Nautilus Script to Launch a Terminal
- SUSE Studio Screenshot Tour
- Edit Your GNOME Configuration
- Open Source Apps for Windows to Introduce Users to FOSS
- Name The Next Apple Product
- Fast Boot Your PC With Xandros Presto
- ► Jul (5)
- ► Jun (7)
- ► May (11)
-
- Command Line Basics: Create Custom Commands with Alias
- Command Line Basics: List Files with ls
- Space Saving Tips for Your GNOME Desktop
- Windows Web Browser Shootout
- Command Line Basics: Navigating the File System
- Bash to Basics: Print Text with echo
- Command Line Basics: echo
- Install the Firefox 3.5 Beta in Linux
- Create a Bootable USB Drive with Ubuntu and FreeDOS
- Revert the Update Behavior in Jaunty to the Old Way
- Who Needs Windows?
- ► Apr (11)
-
- Install Picasa 3.0 for Linux (beta)
- Eight Reasons Your Next Computer Should Run Linux
- Jaunty Boots 32% Faster on the MSI Wind
- The Jackalope is Jaunting!
- Windows 7 Won't Close the Door For Linux
- Upgrade Ubuntu with a CD Image
- Get a Jump on Jaunty Jackalope
- Secure File Transfer in Nautilus with SFTP
- Add the NT Backup Tool to Windows XP
- Why I hate Dell
- How To Install AVG Antivirus 7.5 in Ubuntu
- ► Mar (13)
-
- Create an Encrypted Folder in Ubuntu with Cryptkeeper
- How To Create Multiple Firefox Profiles in Windows
- Install the Fedora 10 Desktop Theme in Ubuntu
- Download the Fedora 10 Wallpaper
- How To Install the Echo Icon Theme in Ubuntu
- How To Install the Nodoka Theme Engine in Ubuntu
- Create Your Own .deb Packages with Checkinstall
- Install Your Own Ringtones with Ubuntu and BitPim
- Install Multimedia Codecs in Ubuntu 8.04
- Use Linux to Solve the Linux Journal Scramble
- Dvorak Rings Death Knell for Microsoft's Business Model
- Microsoft to Release Windows Linux!
- Review: Sabrent 68 in 1 Internal Card Reader
- ► Feb (2)
- ► Jan (4)
- ► 2008 (37)
- ► Dec (8)
-
- Update: Logitech LX8 in Ubuntu
- Create a Button to Restart USB in Ubuntu
- Create an Ubuntu Live USB Drive
- Install Fedora Cursor Theme in Ubuntu
- Change the Week Start Day in Ubuntu
- Automatically Update the ClamAV Virus Database
- Add On-Demand Virus Scanning to Nautilus
- Put Your Own Face on Tux - Wii Fit Review
- ► Nov (6)
- ► Oct (8)
-
- Ubuntu 8.10 is Out!
- Split mp3 Files With mp3splt
- How To Install RealPlayer 11 in Ubuntu
- How To Install Free42 in Ubuntu
- Review - Sony MDR-NC6 Noise Canceling Headphones
- How To Set Up a Home Network With Ubuntu, Part 3
- How To Set Up a Home Network With Ubuntu, Part 2
- How To Set Up a Home Network With Ubuntu, Part 1
- ► Sep (6)
- ► Aug (9)
-
- How To Control Fan Speeds in Ubuntu
- How To Install avast! Antivirus in Windows XP
- How to Launch a Program in Ubuntu Without Using The Menu
- Review - Logitech LX8 in Windows XP
- Google Starts "Free The Airwaves" PR Campaign
- Review - Logitech LX8 Cordless Laser Mouse
- Subway Doesn't Like Linux!
- How To Add An Item To Ubuntu's Menu
- How to resample MP3 audio files on Linux using LAME
Favorite Sites



This would be better in a for loop (eliminating the need for xargs):
for pkg in `dpkg -l *apache* *mysql* phpmyadmin | grep ^ii | awk '{ print $2}'`; do apt-get -y purge --auto-remove $pkg; done;
I gave your command a try. It works as long as I add a sudo to the apt-get command so it looks like this:
What I don't like about it is that it ends up running apt-get multiple times. apt-get carries some overhead with it, so your command will take longer to execute. I did a little benchmarking to confirm my suspicion. My command takes about 45 seconds to execute on my computer while your version takes about 74 seconds. In the end, it's not a big deal either way.
It just goes to show that there are often many ways to do things. I don't tend to use for loops very often on the command line, so thanks for offering your perspective.
I am running Ubuntu 10.04 under Virtual Box on a MAC Host. I have attempted to do a LAMP installation per instructions found online. I have successfully installed everything but the PHPMyAdmin. Something is wrong with the installation, but I have no way of knowing what it is. The command line instructions for the install, were clear, the process just wouldn't complete. And I've tried to go back and re-install PHPMyAdmin several times, now it tells me there's nothing to change or update, but I cannot access PHPMyAdmin in a browser, so it was obviously unsuccessful.
I want to uninstall JUST the PHPMyAdmin and try again. Can you give me a line of code that would do that?
Thanks, WCW
You probably forgot to select apache2 during the configuration of phpMyAdmin during installation. You don't need to reinstall phpMyAdmin. You can fix the configuration by following the instructions here: http://tuxtweaks.com/2010/04/installing-lamp-on-ubuntu-10-04-lucid-lynx/comment-page-1/#comment-2952
If you still want to uninstall phpMyAdmin, you can do it with:
thank you..
i want to reinstall my lamp
Thanks so much! That made life easy. Lamp is gone!
this don't will delete the var/www/ directory right?
Little heads up, this command removed my Eclipse packages and my Eclipse-platform
-may i delete every folder like's apache2, php5, mysql, and phpmyadmin?
i was panic and i do that.. and my lamp was error.. they did'nt work well..
can you give some guide,, how to reinstall my lamp ?
thanks
This post will help you reinstall LAMP: http://tuxtweaks.com/2012/04/installing-lamp-on-ubuntu-12-04-precise-pangolin/
Vorsicht! This tears out your Kubuntu/KDE-Desktop too! (At least on my Kubuntu 12.10)
You're right! I just tried it on Kubuntu 12.04 and it happened to me. It's easily fixed with:
Apparently kubuntu-desktop has some MySQL dependencies. After reinstalling it everything seems to be fine. All of my other software is still there.
thanks, worked perfectly for me. Now i can re-install lamp from the scratch.