前往小程序,Get更优阅读体验!
立即前往
首页
学习
活动
专区
圈层
工具
发布
首页
学习
活动
专区
圈层
工具
MCP广场
社区首页 >专栏 >rpm 安装 忽略依赖_rpm卸载软件忽略循环依赖

rpm 安装 忽略依赖_rpm卸载软件忽略循环依赖

作者头像
全栈程序员站长
发布于 2022-11-08 12:47:05
发布于 2022-11-08 12:47:05
2.1K0
举报

大家好,又见面了,我是你们的朋友全栈君。

今天由于某些原因需要卸载掉服务器上的php软件,然后我使用下面命令显示出本机安装的所有和php相关的软件,如下: iteblog$ rpm -qa | grep php

php-mysqlnd-5.6.25-0.1.RC1.el6.remi.x86_64

php-fpm-5.6.25-0.1.RC1.el6.remi.x86_64

php-pecl-jsonc-1.3.10-1.el6.remi.5.6.x86_64

php-pecl-memcache-3.0.8-3.el6.remi.5.6.x86_64

php-pdo-5.6.25-0.1.RC1.el6.remi.x86_64

php-mbstring-5.6.25-0.1.RC1.el6.remi.x86_64

php-pear-1.9.4-4.el6.noarch

php-cli-5.6.25-0.1.RC1.el6.remi.x86_64

php-gd-5.6.25-0.1.RC1.el6.remi.x86_64

php-pecl-zip-1.13.4-1.el6.remi.5.6.x86_64

php-pecl-apcu-4.0.11-2.el6.remi.5.6.x86_64

php-common-5.6.25-0.1.RC1.el6.remi.x86_64

php-5.6.25-0.1.RC1.el6.remi.x86_64

php-mcrypt-5.6.25-0.1.RC1.el6.remi.x86_64

然后我一一把它们卸载掉,如下: iteblog$ rpm -e php-mysqlnd-5.6.25-0.1.RC1.el6.remi.x86_64

一切都很正常,但是当卸载到php-pecl-jsonc-1.3.10-1.el6.remi.5.6.x86_64和php-pecl-zip-1.13.4-1.el6.remi.5.6.x86_64的时候出现以下的错误: [iteblog@iteblog.com ~] $ rpm -e php-pecl-jsonc-1.3.10-1.el6.remi.5.6.x86_64

error: Failed dependencies:

php-pecl-jsonc(x86-64) is needed by (installed) php-common-5.6.25-0.1.RC1.el6.remi.x86_64

[iteblog@iteblog.com ~] $ rpm -e php-pecl-zip-1.13.4-1.el6.remi.5.6.x86_64

error: Failed dependencies:

php-pecl-zip(x86-64) is needed by (installed) php-common-5.6.25-0.1.RC1.el6.remi.x86_64

很容易就可以看出php-pecl-jsonc和php-pecl-zip都被php-common-5.6.25-0.1.RC1.el6.remi.x86_64依赖,所有理所当然的想到先卸载php-common-5.6.25-0.1.RC1.el6.remi.x86_64,如下: [root@iteblog.com ~] $ rpm -e php-common-5.6.25-0.1.RC1.el6.remi.x86_64

error: Failed dependencies:

php(api) = 20131106-64 is needed by (installed) php-pecl-jsonc-1.3.10-1.el6.remi.5.6.x86_64

php(api) = 20131106-64 is needed by (installed) php-pecl-zip-1.13.4-1.el6.remi.5.6.x86_64

php(zend-abi) = 20131226-64 is needed by (installed) php-pecl-jsonc-1.3.10-1.el6.remi.5.6.x86_64

php(zend-abi) = 20131226-64 is needed by (installed) php-pecl-zip-1.13.4-1.el6.remi.5.6.x86_64

当看到上面的错误信息的时候我只想说fuck!php-common居然又被php-pecl-jsonc和php-pecl-zip依赖,这岂不是变成了循环依赖了吗?这时候我想到了man命令,看到了rmp命令还有个–nodeps参数: [root@iteblog.com ~] $ man rpm

……………………这里省略了很多输出…………………

–nodeps

Don’t do a dependency check before installing or upgrading a package.

……………………这里省略了很多输出…………………

这不就是卸载的时候忽略依赖检测吗?然后我使用下面命令顺利地卸载了上面三个软件包: [root@iteblog.com ~] $ rpm –nodeps -e php-common-5.6.25-0.1.RC1.el6.remi.x86_64

[root@iteblog.com ~] $ rpm –nodeps -e php-pecl-zip-1.13.4-1.el6.remi.5.6.x86_64

[root@iteblog.com ~] $ rpm –nodeps -e php-pecl-jsonc-1.3.10-1.el6.remi.5.6.x86_64

[root@iteblog.com ~] $ rpm -qa|grep php

终于卸载干净了!有困难找man啊。

版权声明:本文内容由互联网用户自发贡献,该文观点仅代表作者本人。本站仅提供信息存储空间服务,不拥有所有权,不承担相关法律责任。如发现本站有涉嫌侵权/违法违规的内容, 请发送邮件至 举报,一经查实,本站将立刻删除。

发布者:全栈程序员栈长,转载请注明出处:https://javaforall.cn/190726.html原文链接:https://javaforall.cn

本文参与 腾讯云自媒体同步曝光计划,分享自作者个人站点/博客。
原始发表:2022年9月22日 ,如有侵权请联系 cloudcommunity@tencent.com 删除

本文分享自 作者个人站点/博客 前往查看

如有侵权,请联系 cloudcommunity@tencent.com 删除。

本文参与 腾讯云自媒体同步曝光计划  ,欢迎热爱写作的你一起参与!

评论
登录后参与评论
0 条评论
热度
最新
推荐阅读
领券
问题归档专栏文章快讯文章归档关键词归档开发者手册归档开发者手册 Section 归档