Last Updated on April 20, 2020 by Vikash Ekka
How to Uninstall PHP, Apache and MySQL on Ubuntu 18.04 LTS |
Prerequisites:-
Need sudo/root priviledges
First we remove PHP from Ubuntu 18.04 LTS.
sudo apt-get remove –purge php*
sudo apt-get purge php*
sudo apt-get autoremove
sudo apt-get autoclean
sudo apt-get remove dbconfig-php
sudo apt-get dist-upgrade
sudo apt-get purge 'php*'
sudo apt-get remove –purge php7.3*
sudo apt-get purge php7.3*
whereis php
sudo rm -rf /etc/php
sudo apt-get autoremove
sudo apt-get autoclean
sudo apt-get remove dbconfig-php
sudo apt-get dist-upgrade
Now we remove Apache2 from Ubuntu.
sudo service apache2 stop
sudo apt-get purge apache2 apache2-utils apache2.2-bin apache2-common
sudo apt-get autoremove
Finally we are removing MySql 5.7 from Ubuntu.
sudo apt-get remove –purge mysql*
sudo apt-get purge mysql*
sudo apt-get autoremove
sudo apt-get autoclean
sudo apt-get remove dbconfig-php
sudo apt-get dist-upgrade
Removing directories from their respective default locations.
sudo rm -rf /etc/apache2
sudo rm -rf /etc/php
sudo rm -rf /var/lib/mysql
sudo rm etc/mysql
Conclusion
Conclusion
Congratulation you have successfully uninstalled or removed LAMP- PHP, apache2, and MySql from Ubuntu 18.04 LTS. Let me know in the comment box if you are facing any difficulties while executing above commands.
Also Read:- How To Install Linux, Apache, MySQL, PHP (LAMP) on Ubuntu
Also Read:- How to Install MySQL 8.0 on Ubuntu 16.04 LTS ??
Also Read:- Uninstall or Remove MySql 5.7 from Ubuntu 20.04 LTS.
Thank you for sharing this.