How can I completely uninstall LAMP installed in the Ubuntu 18.04 which is running in the VM, from the code I like to remove and make completely free now.


Assuming you are removing the "AMP" from the "LAMP" (you wouldn't like to remove the Linux, too), the following should work in most cases. The first command removes Apache, MySQL and PHP. The rest cleans up the packages that were only required by these packages. The purge removes all the configuration files, too; if you wish to preserve the configuration, use remove instead.

sudo apt-get purge apache2 mysql-server php
sudo apt autoremove
sudo apt autoclean
| improve this answer | |

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.