Shut down Apache:
sudo /etc/init.d/apache2 stop
Shut down MySQL:sudo /etc/init.d/mysql stop
Remove the entire LAMP stack:sudo apt-get purge apache2 php5-mysql libapache2-mod-php5 mysql-server php5 phpmyadmin
- Note the use of purge instead of remove -- this gets rid of configuration files as well.
- You will need to download everything from the archives during the reinstall.
- Stuff in /var/www will not be removed.
sudo apt-get install apache2 php5-mysql libapache2-mod-php5 mysql-server php5 phpmyadmin