For system, network and cloud administrators
The shell is one of the most important parts of a Unix system and that’s why developers and admins around the world rely so much on it. It’s basically a program inside which the user can run commands and create shell scripts. Unix programmers used the shell as a programming environment too. In fact, a lot of the important parts of the Unix system itself are … shell scripts.
sudo /etc/init.d/apache2 status
If you’re seeing an “Active (running)“ message then it means that your Apache2 process is still running and we need to stop it.
sudo /etc/init.d/apache2 stop
sudo /etc/init.d/apache2 status
Notice that now, the “Active” section says “inactive“.
sudo apt-get purge apache2* -y
sudo apt-get autoremove -y
whereis apache2
If the result/output of the command above is empty, then Apache2 has been successfully uninstalled from your Ubuntu 18.04 LTS.