Ubuntu uninstalls apache2, php5, and mysql

Source: Internet
Author: User
I thought that for the next bunch of ubuntu commands, you only need to find the correct command, and it is not that troublesome. What's tricky is that there are so many results on the Internet that I don't know the method I just created. I don't have a good idea that the next bunch of commands in ubuntu can be found as long as the correct command is found, not that troublesome. What's tricky is that there are so many results on the Internet that you don't know how to create them at all. The whole process of apache was handled seven or eight times. It took over two hours.

Finally, I finally saw a person's approach in a forum. I found the command is a little different from other people, so I tried it.

Method:

Sudo apt-get-purge remove apache2
Sudo apt-get-purge remove apache2-common
Sudo apt-get-purge remove apache2-utils

Sudo apt-get autoremove apache2
(-Purge indicates that the configuration file is not retained. this is definitely not enough)

Then sudo apt-get install apache2.

PS: If not, delete all the items about apache2, because I have killed all the items before executing these commands.

Delete the/etc/apache2 folder: sudo rm-r/etc/apache2

Delete the/var/www folder: sudo rm-r/var/www

Delete the/etc/init. d/apache2 File: sudo rm-r/etc/init. d/apache2

Then uninstall PHP5.

The method is as follows:

Sudo apt-get-purge remove libapache2-mod-php5 php5 php5-gd php5-mysql

Sudo apt-get autoremove php5

The following describes how to uninstall MYSQL:

Run the following command on the terminal:

1 sudo apt-get autoremoving-purge mysql-server-5.0
2 sudo apt-get remove mysql-server
3 sudo apt-get autoremove mysql-server
4 sudo apt-get remove mysql-common (very important)

The following sentence shows the residual information.

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

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.