CentOS 7 Uninstall Apache mariadb PHP and other methods

Source: Internet
Author: User

Due to work needs, may have to carry out Apache mariadb PHP services such as uninstall, gossip not much to say, directly on the method.


Apache Uninstall

Our first example would be to take Apache for an axe. Believe it or not, now I'm going to unload it from CentOS, don't ask why, you know! Execute the following line of code

# Rpm-qa|grep HTTPD

The terminal window can then display the following two messages

Httpd-2.4.6-40.el7.centos.1.x86_64httpd-tools-2.4.6-40.el7.centos.1.x86_64

Great, we've found our prey, and the next step is to be targeted.

# RPM-E Httpd-2.4.6-40.el7.centos.1.x86_64

The following error is prompted after carriage return

error:failed DEPENDENCIES:HTTPD-MMN = 20120211x8664 is needed by (installed) php-5.4.16-36.1.el7_2.1.x86_64

A little bit of English-speaking friends probably already know what this is about, which means that PHP relies on the Apache environment.

So we have to get rid of the "Black Hand" behind this.

Before we kill it, we must understand the PHP capabilities of the geometry, the configuration of what equipment is right, after all, the enemy, Baizhanbudai! Execute command

# rpm-qa|grep PHP

The terminal will list the following information (this will vary from person to person, depending on how many extensions you have installed)

[[email protected] ~]# rpm -qa|grep phpphp-cli-5.4.16-36.1.el7_2.1.x86_ 64php-pear-1.9.4-21.el7.noarchphp-mbstring-5.4.16-36.1.el7_2.1.x86_64php-common-5.4.16-36.1.el7_2.1.x86_ 64php-process-5.4.16-36.1.el7_2.1.x86_64php-xml-5.4.16-36.1.el7_2.1.x86_64php-gd-5.4.16-36.1.el7_2.1.x86_ 64php-ldap-5.4.16-36.1.el7_2.1.x86_64php-pdo-5.4.16-36.1.el7_2.1.x86_64php-mysql-5.4.16-36.1.el7_2.1.x86_ 64php-bcmath-5.4.16-36.1.el7_2.1.x86_64php-5.4.16-36.1.el7_2.1.x86_64php-odbc-5.4.16-36.1.el7_2.1.x86_ 64php-xmlrpc-5.4.16-36.1.el7_2.1.x86_64 

Extension so, which one do we want to erase? The answer is that you can delete all, you can just delete the error php-5.4.16-36.1.el7_2.1.x86_64, below I will simply delete php-5.4.16-36.1.el7_2.1.x86_64 this stumbling block.

# RPM-E Php-5.4.16-36.1.el7_2.1.x86_64

Once this is done, you

# rpm-qa|grep PHP

Look under, there is no trace of php-5.4.16-36.1.el7_2.1.x86_64 in the information listed. The next thing to do is to uninstall Apache.

# RPM-E Httpd-2.4.6-40.el7.centos.1.x86_64

After execution, you will be prompted with the following

Warning:/etc/httpd/conf/httpd.conf saved As/etc/httpd/conf/httpd.conf.rpmsave

Do not take care of it, now execute the command

# Rpm-qa|grep HTTPD

There's only one left.

Httpd-tools-2.4.6-40.el7.centos.1.x86_64

OK, here we have finished uninstalling the Apache service.

If you feel that the above two-step implementation is troublesome, then you can use the following line of command to twofold.

# Yum Erase httpd

This command line automatically uninstalls the httpd service for you, and if you have a service (such as PHP) that relies on Apache, it will be uninstalled together.

MariaDB Uninstall

To give you a more detailed understanding of the Yum Erase command line, let me use yum erase * (* on behalf of the service, such as: mariadb,apache,ftp,php) to give an example, because I am using CentOS 7, so I also installed a MariaDB database, So take it as a white mouse.

Following is the execution record of the Yum Erase mariadb command

[[Email protected] ~]# rpm -qa|grep mariadbmariadb-devel-5.5.47-1.el7_2.x86_ 64mariadb-embedded-5.5.47-1.el7_2.x86_64mariadb-bench-5.5.47-1.el7_2.x86_64mariadb-server-5.5.47-1.el7_2.x86_ 64mariadb-test-5.5.47-1.el7_2.x86_64mariadb-libs-5.5.47-1.el7_2.x86_64mariadb-embedded-devel-5.5.47-1.el7_2. X86_64mariadb-5.5.47-1.el7_2.x86_64[[email protected] ~]# rpm -e mariadb-5.5.47-1.el7 _2.X86_64ERROR: FAILED DEPENDENCIES:MARIADB (x86-64)  = 1:5.5.47-1.el7_2 is needed  by  (installed)  mariadb-server-1:5.5.47-1.el7_2.x86_64mariadb (x86-64)  = 1:5.5.47-1. el7_2 is needed by  (installed)  mariadb-test-1:5.5.47-1.el7_2.x86_64mariadb (x86-64)  = 1:5.5.47-1.el7_2 is needed by  (installed)  mariadb-bench-1:5.5.47-1.el7_ 2.x86_64[[email protected] ~]# yum erase mariadb-5.5.47-1.el7_2.x86_64loaded  Plugins: fastestmirrorresoLving dependencies--> running transaction check---> package mariadb.x86_64  1:5.5.47-1.EL7_2 WILL BE ERASED--> PROCESSING DEPENDENCY: MARIADB ( X86-64)  = 1:5.5.47-1.el7_2 for package: 1:mariadb-bench-5.5.47-1.el7_2.x86_64-->  PROCESSING DEPENDENCY: MARIADB (x86-64)  = 1:5.5.47-1.el7_2 for package:  1:MARIADB-TEST-5.5.47-1.EL7_2.X86_64--> PROCESSING DEPENDENCY: MARIADB (x86-64)  =  1:5.5.47-1.el7_2 for package: 1:mariadb-server-5.5.47-1.el7_2.x86_64--> running  transaction check---> package mariadb-bench.x86_64 1:5.5.47-1.el7_2 will  be erased---> package mariadb-server.x86_64 1:5.5.47-1.el7_2 will be  erased---> Package mariadb-test.x86_64 1:5.5.47-1.el7_2 will be  Erased--> finished dependency resolutiondependencies resolved================================================================ =============================================================================================================== ================================package arch version repository size====================== =============================================================================================================== ==========================================================================removing:mariadb x86_64  1:5.5.47-1.el7_2  @updates  49 mremoving for dependencies:mariadb-bench x86_64  1:5.5.47-1.el7_2  @updates  2.6 mmariadb-server x86_64 1:5.5.47-1.el7_2 @ updates 56 mmariadb-test x86_64 1:5.5.47-1.el7_2  @updates  124 mtransaction  summary================================================================================================= ==============================================================================================================remove 1  Package  (+3 dependent packages) Installed size: 231 mis this ok  [y/N]: yDownloading packages:Running transaction checkRunning transaction  Testtransaction test succeededrunning transactionwarning: rpmdb altered outside  of yum. Erasing : 1:mariadb-bench-5.5.47-1.el7_2.x86_64 1/4erasing : 1: mariadb-test-5.5.47-1.el7_2.x86_64 2/4erasing : 1:mariadb-server-5.5.47-1.el7_2.x86_64 3/ 4warning: /var/log/mariadb/mariadb.log saved as /var/log/mariadb/ Mariadb.log.rpmsaveerasing : 1:mariadb-5.5.47-1.el7_2.x86_64 4/4verifying : 1: mariadb-bench-5.5.47-1.el7_2.x86_64 1/4verifying : 1:mariadb-test-5.5.47-1.el7_2.x86_64 2/ 4verifying : 1:mariadb-server-5.5.47-1.el7_2.x86_64 3/4verifying : 1:mariadb-5.5.47-1.el7_2.x86_64 4/4removed:mariadb.x86_64  1:5.5.47-1.el7_2dependency removed:mariadb-bench.x86_64 1:5.5.47-1.el7_2 mariadb-server.x86_64  1:5.5.47-1.el7_2 mariadb-test.x86_64 1:5.5.47-1.el7_2complete! [[Email protected] ~]# rpm -qa|grep mariadbmariadb-devel-5.5.47-1.el7_2.x86_ 64mariadb-embedded-5.5.47-1.el7_2.x86_64mariadb-libs-5.5.47-1.el7_2.x86_64mariadb-embedded-devel-5.5.47-1.el7_ 2.x86_64

If you look carefully enough, you will see Yum erase * This command line is how to delete the target service step-by-step and how to handle the services on which the target service is to be deleted.

Take care of the lunch!!

CentOS 7 Uninstall Apache mariadb PHP and other methods

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.