First, uninstall and delete MySQL
1 sudo apt-get autoremove--purge mysql-server-5.0
2 sudo apt-get remove mysql-server
3 sudo apt-get autoremove mysql-server
4 sudo apt-get remove Mysql-common (very important)
Clean up residual data:
Dpkg-l |grep ^rc|awk ' {print $} ' |sudo Xargs dpkg-p
sudo find/etc-name "*mysql*" |xargs RM-RF
Finally with Dpkg-l | grep MySQL Check, if no return is a clean uninstall
Ii. Uninstall and delete Apache
sudo apt-get--purge Remove Apache-common
sudo apt-get--purge remove Apache
Find a profile that is not deleted and delete it
sudo find/etc-name "*apache*" |xargs RM-RF
sudo rm-rf/var/www
sudo rm-rf/etc/libapache2-mod-jk
sudo rm-rf/etc/init.d/apache2
sudo rm-rf/etc/apache2
Delete Association,
Dpkg-l |grep Apache2|awk ' {print $} ' |xargs Dpkg-p
Delete SVN
sudo apt-get remove subversion
sudo apt-get remove libapache2-svn
Finally with Dpkg-l | grep Apache and Dpkg-l | grep apache2 Check, clean unload if no return
Third, uninstall and delete PHP
sudo apt-get–purge remove libapache2-mod-php5 php5 php5-gd php5-mysql
sudo apt-get autoremove php5
Delete Association,
sudo find/etc-name "*php*" |xargs RM-RF
Clear residue Information
Dpkg-l |grep ^rc|awk ' {print $} ' |sudo Xargs dpkg-p
Finally with Dpkg-l | grep php and Dpkg-l | grep php5 Check, clean unload if no return
Ubuntu completely remove/uninstall Mysql,php,apache