Shell/Bash: how to uninstall lamp server in ubuntu 18.04 Example

By

Shell/Bash Example: This is the "how to uninstall lamp server in ubuntu 18.04" Example. compiled from many sources on the internet by SimpleTutorials.org

how to uninstall lamp server in ubuntu 18.04

#!/bin/bash

# This will remove Apache
sudo service apache2 stop
sudo apt-get purge apache2 apache2-utils apache2.2-bin apache2-common
sudo apt remove apache2.*
sudo apt-get autoremove
whereis apache2
sudo rm -rf /etc/apache2

# This will remove PHP
sudo apt-get purge `dpkg -l | grep php7.2| awk '{print $2}' |tr "\n" " "`
sudo apt-get purge php7.*
sudo apt-get autoremove --purge
whereis php
sudo rm -rf /etc/php

# This will remove MYSql
sudo service mysql stop
sudo apt-get remove --purge *mysql\*
sudo apt-get remove --purge mysql-server mysql-client mysql-common -y
rm -rf /etc/mysql
sudo apt-get autoremove
sudo apt-get autoclean


#https://www.fiverr.com/tamerjarrar
sudo reboot


* Summary: This "how to uninstall lamp server in ubuntu 18.04" Shell/Bash Example is compiled from the internet. If you have any questions, please leave a comment. Thank you!

Others