如何在 cent os 中卸载没有依赖项错误的 RPM?

How to uninstall RPM without dependencies error in cent os?

很久以前我安装了 openssl rpm。之后我无法卸载 rpm,因此我删除了 /usr/bin/openssl 文件夹 manually.Though 我手动删除了它,当我使用此命令 grep rpm -qa openssl 我可以找到 rpm。 但是当我在终端中执行 openssl 命令时,它显示 bash: openssl: command not found...

尝试卸载时出现以下错误

[root@genius ~]# rpm -qa openssl
openssl-1.0.2k-8.el7.x86_64

[root@genius ~]# rpm -e openssl-1.0.2k-8.el7.x86_64
error: Failed dependencies:
    /usr/bin/openssl is needed by (installed) authconfig-6.2.8-30.el7.x86_64

而且当我尝试安装 rpm 时它显示以下输出

[root@genius openssl]# rpm -ivh openssl-1.0.2k-8.el7.x86_64.rpm
Preparing...    ################################# [100%]
        package openssl-1:1.0.2k-8.el7.x86_64 is **already installed**

最后, 我需要在我的 centOS 7 中安装 openssl 包,否则我需要完全删除 openssl 包 没有任何依赖性 错误。

这里有几个选项:

1. Remove using yum, Note: this may remove the dependency such as authconfig
$ yum remove openssl

2. Remove using rpm cmdline, but you have to force remove it. This will not remove the depencies
$ rpm -e openssl-1.0.2k-8.el7.x86_64 --nodeps

3. or try a reinstall if you have CentOS-7 repo
$ yum reinstall openssl

如果你想在你的系统中使用 openssl,我会先尝试 (3)。如果这不起作用,请尝试 (2),然后执行 yum install openssl。 (3) 和 (1) 是要使用的选项。 (2) 会导致依赖包滞留在系统中,导致依赖包出现故障