Get the App
SLTechnology News&Howtos  ›  Servers  › 

Ubuntu's method tutorial for completely uninstalling MySQL, Apache2, and Php

Shulou Source: shulou.com Published: 2022-06-02 02:20:55 10月22日 Update

Preface

It is very convenient for us to use one-click installation during installation, but it is always unclean when we want to uninstall. Here's how to completely uninstall MySQL, Apache2 and Php in Ubuntu, and share them for your reference and study. Let's take a look at the detailed introduction:

Uninstall and delete mysql

1 sudo apt-get autoremove-purge mysql-server-5.02 sudo apt-get remove mysql-server3 sudo apt-get autoremove mysql-server4 sudo apt-get remove mysql-common (very important)

In fact, some of the above are superfluous, so the suggestions should be carried out in sequence.

Clean up residual data:

Dpkg-l | grep ^ rc | awk'{print $2}'| sudo xargs dpkg-Psudo find / etc-name "* mysql*" | xargs rm-rf

Finally, use dpkg-l | grep mysql to check. If no return is returned, clean uninstall

2. Uninstall and delete apache

Sudo apt-get-purge remove apache-commonsudo apt-get-purge remove apache

Find the configuration files that have not been deleted and delete them as well

Sudo find / etc-name "* apache*" | xargs rm-rf sudo rm-rf / var/wwwsudo rm-rf / etc/libapache2-mod-jksudo rm-rf / etc/init.d/apache2sudo rm-rf / etc/apache2

Delete Association

Dpkg-l | grep apache2 | awk'{print $2}'| xargs dpkg-P

Delete svn

Sudo apt-get remove subversionsudo apt-get remove libapache2-svn

Finally, check with dpkg-l | grep apache and dpkg-l | grep apache2. If no return is returned, clean uninstall

Uninstall and delete php

Sudo apt-get-purge remove libapache2-mod-php5 php5 php5-gd php5-mysqlsudo apt-get autoremove php5

Delete Association

Sudo find / etc-name "* php*" | xargs rm-rf

Clear residual information

Dpkg-l | grep ^ rc | awk'{print $2}'| sudo xargs dpkg-P

Finally, check with dpkg-l | grep php and dpkg-l | grep php5. If no return is returned, clean uninstall

Summary

The above is the whole content of this article, I hope that the content of this article can bring some help to your study or work, if you have any questions, you can leave a message and exchange, thank you for your support.

Tags: Clean content check time relevance learning residue clear important information preface that is suggestions data documents questions articles can bring or face Apple Docker Huawei Linux macOS MariaDB Microsoft MySQL NVidia OPPO Reno macOS NVidia Microsoft Huawei Docker