,,由于工作需要,可能要进行Apache mariadb php等服务的卸载,闲话不多说,直接上方法。
Apache卸载
我们的第一个例子就先拿Apache来开刀。不管你信不信现在我就要把它从Centos里卸载掉,不要问为什么,你懂的!执行下面一行代码
#, rpm qa | grep httpd
然后终端窗口就可显示如下两条信息
httpd - 2.4.6 - 40. - el7.centos.1.x86_64httpd el7.centos.1——工具- 2.4.6 - 40.。x86_64
很棒,我们已经找到猎物了,下一步要做的就是有的放矢
#, rpm -e httpd - 2.4.6 - 40. - el7.centos.1。x86_64
回车后竟然提示如下错误
<>之前错误:,Failed 依赖关系: 时间=httpd-mmn 20120211 x8664 is  needed by (安装),php-5.4.16-36.1.el7_2.1。x86_64稍微懂点英文的朋友估计已经知道这是什么回事了,大概意思就是说,php依赖了Apache环境。
所以我们得先把这个幕后的“黑”手干掉。
在干掉它之前,我们肯定得了解下php的能力几何,配置了什么装备对吧,毕竟知己知彼,百战不殆!执行命令
#, rpm , qa | grep php
终端会列出如下信息(这个会因人而异,就看你之前安装了多少扩展)
[root@niaoyun53098 ~] #, rpm qa | grep phpphp-cli-5.4.16-36.1.el7_2.1.x86_64 php -梨1.9.4 el7.noarch——21. php-mbstring-5.4.16-36.1.el7_2.1.x86_64 php-common-5.4.16-36.1.el7_2.1.x86_64 php-process-5.4.16-36.1.el7_2.1.x86_64 php-xml-5.4.16-36.1.el7_2.1.x86_64 php-gd-5.4.16-36.1.el7_2.1.x86_64 php-ldap-5.4.16-36.1.el7_2.1.x86_64 php-pdo-5.4.16-36.1.el7_2.1.x86_64 php-mysql-5.4.16-36.1.el7_2.1.x86_64 php-bcmath-5.4.16-36.1.el7_2.1.x86_64 php-5.4.16-36.1.el7_2.1.x86_64 php-odbc-5.4.16-36.1.el7_2.1.x86_64 php-xmlrpc-5.4.16-36.1.el7_2.1。x86_64
扩展这么之,我们要删掉哪一个?答案是你可以全删了,也可以只删掉刚才报错的,php-5.4.16-36.1.el7_2.1.x86_64、下面我就简单点只删掉,php-5.4.16-36.1.el7_2.1。x86_64这个绊脚石。
#, rpm -e php-5.4.16-36.1.el7_2.1。x86_64
这个执行完之后,你再
#, rpm qa | grep php
查看下,在列出的信息中已经不见了,php-5.4.16-36.1.el7_2.1。x86_64的踪影了。接下来要做的就是卸载Apache了。
#, rpm -e httpd - 2.4.6 - 40. - el7.centos.1。x86_64
执行完后会有如下提示
<>之前警告:,/etc/httpd/conf/httpd.conf saved as /etc/httpd/conf/httpd . conf。rpmsave不用管它,现在执行下命令
#, rpm , qa | grep httpd
里面只剩下
httpd -工具- 2.4.6 - 40. - el7.centos.1。x86_64
好了,到这里已经完成了Apache服务的卸载。
如果你觉得上面分两步执行很麻烦,那么你可以使用下面这一行命令来一石两鸟。
#, yum erase httpd
这个命令行会自动的帮你卸载httpd服务,如果有其实服务(如php)依赖于Apache的话,也会一同被卸载。
MariaDB卸载
为了让你更详细的了解,百胜擦掉这个命令行,下面我用yum擦掉*(*代表服务,如:MariaDB, Apache, FTP, php)再来举个例子,由于我用的是centos 7,所以也装了一个MariaDB数据库,所以就拿它来当这次的小白鼠吧。
下面是百胜擦掉MariaDB命令的执行记录
[root@niaoyun53098 ~] #, rpm qa | grep mariadbmariadb 5.5.47 - 1. el7_2.x86_64——重击 mariadb 5.5.47 - 1. el7_2.x86_64——嵌入式 mariadb 5.5.47 - 1. el7_2.x86_64——板凳 mariadb 5.5.47 - 1. el7_2.x86_64——服务器 mariadb -测试- 5.5.47 - 1. - el7_2.x86_64 mariadb 5.5.47 - 1. el7_2.x86_64——填词 mariadb -嵌入式猛击5.5.47 - 1. - 1. el7_2.x86_64mariadb - 5.5.47 el7_2.x86_64 (root@niaoyun53098 ~) #, rpm -e mariadb el7_2.x86_64——5.5.47 - 1. 错误:,Failed 依赖关系: mariadb (x86 - 64),=, 1:5.5.47 - 1. - el7_2 is needed by (安装),mariadb 1:5.5.47 - 1. el7_2.x86_64——服务器 mariadb (x86 - 64),=, 1:5.5.47 - 1. - el7_2 is needed by (安装),mariadb -测试- 1:5.5.47 - 1. - el7_2.x86_64 mariadb (x86 - 64),=, 1:5.5.47 - 1. - el7_2 is needed by (安装),mariadb 1:5.5.47 - 1. el7_2.x86_64——板凳 (root@niaoyun53098 ~) #, yum erase mariadb el7_2.x86_64——5.5.47 - 1. Loaded 插件:fastestmirror Resolving 依赖关系 ——在Running transaction 检查 ——→,Package mariadb.x86_64  1:5.5.47 - 1. - el7_2 will be ,抹去 ——祝辞,Processing 依赖:,mariadb (x86 - 64),=, 1:5.5.47 - 1. - el7_2 for 包:,1:mariadb 5.5.47 - 1. el7_2.x86_64——板凳 ——祝辞,Processing 依赖:,mariadb (x86 - 64),=, 1:5.5.47 - 1. - el7_2 for 包:,1:mariadb -测试- 5.5.47 - 1. - el7_2.x86_64 ——祝辞,Processing 依赖:,mariadb (x86 - 64),=, 1:5.5.47 - 1. - el7_2 for 包:,1:mariadb 5.5.47 - 1. el7_2.x86_64——服务器 ——在Running transaction 检查 ——→,Package mariadb-bench.x86_64  1:5.5.47 - 1. - el7_2 will be ,抹去 ——→,Package mariadb-server.x86_64  1:5.5.47 - 1. - el7_2 will be ,抹去 ——→,Package mariadb-test.x86_64  1:5.5.47 - 1. - el7_2 will be ,抹去 ——祝辞,Finished Dependency 决议 Dependencies 解决===============================================================================================================================================================================================================Package Arch  Version Repository 大小 null null null null null null null null null null null null null null null null null null null null null null null null nullCentOS 7卸载Apache mariadb php等方法