【问题标题】:RPM install/uninstall deadlockRPM 安装/卸载死锁
【发布时间】:2018-12-17 07:48:23
【问题描述】:

我有一个问题:无法安装包“TD-agent”。原因有死锁:

如果你尝试安装 (sudo rpm -ivh /my/pass/td-agent-3.2.1-0.el7.x86_64.rpm) - 你有一个错误:

Preparing...                          ################################# [100%]
        package td-agent-3.2.1-0.el7.x86_64 is already installed

如果你尝试卸载它 (rpm -e td-agent) - 还有另一个错误:

Stopping td-agent ...
error reading information on service td-agent: No such file or directory
error: %preun(td-agent-3.2.1-0.el7.x86_64) scriptlet failed, exit status 1
error: td-agent-3.2.1-0.el7.x86_64: erase failed

所以,我什么都做不了:不安装,不卸载...

请回答:如何手动卸载它? RPM 使用哪些 DIR 来安装软件包?

【问题讨论】:

    标签: rpm yum fluent td-agent


    【解决方案1】:
    1. 您可以强制rpm 重新安装具有相同编号的软件包,使用:rpm -ivh /my/pass/td-agent-3.2.1-0.el7.x86_64.rpm --replacepkgs
    2. 您可以通过告诉 rpm 不要运行脚本来强制卸载:rpm -e td-agent --noscripts

    【讨论】:

    • 抱歉,脚本已执行,但什么也没做:rpm -e td-agent --noscripts 排在第二位,但在它之后 sudo systemctl status td-agent 打印的 td-agent 仍然存在,甚至可以工作。
    • 两者是有区别的:运行rpm -q td-agent检查是否还安装了包。可能不是。然而,Systemd 将您的文件保存在缓存中;所以它仍在运行。
    • “卸载”是否意味着:1. 停止所有子进程,2. 删除包,3. 删除所有依赖项(如文件夹)?那么,卸载意味着:sudo systemctl start td-agent >>> Failed to start td-agent.service: Unit not found. 不是吗?
    • 没有。卸载意味着:删除所有文件。时期。发生什么其他情况取决于您在规范文件中指定的脚本(但请注意,为了强制卸载,我们现在使用 --noscripts 禁用了它们)
    • fedoraproject.org/wiki/… :关于脚本顺序的一个很好的资源
    【解决方案2】:

    也可以通过命令强制安装

    rpm -Fvh /my/pass/td-agent-3.2.1-0.el7.x86_64.rpm
    

    【讨论】:

      猜你喜欢
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 2011-11-15
      • 2015-11-03
      • 2015-07-21
      • 2014-02-23
      • 2012-12-15
      • 1970-01-01
      相关资源
      最近更新 更多