简体   繁体   English

apt 安装后 package 可执行但无法删除

[英]After apt install the package is executable but can't remove it

After successfully installing the dvips package, it shows up:成功安装dvips package后,显示:

Step 1)
root@CCNM-378B:~# dvips -v
This is dvips(k) 5.997 Copyright 2017 Radical Eye Software (www.radicaleye.com)

But now I'm trying to remove it, and it is invisible to apt:但现在我正在尝试删除它,它对 apt 是不可见的:

Step 2)
root@CCNM-378B:~# apt purge dvips
Reading package lists... Done
Building dependency tree
Reading state information... Done
Package 'dvips' is not installed, so not removed

Now I try dpkg, which shows nothing:现在我尝试 dpkg,它什么也没显示:

root@CCNM-378B:~# dpkg -l | grep "dvips"

Finally, I tried 'apt list' and there are dvips fonts, but nothing else.最后,我尝试了 'apt list' 并且有 dvips fonts,但没有别的。

root@CCNM-378B:~# apt list | grep "dvips"
dvips-fontdata-n2bk/bionic 0.0.2001.12.12-4 all

So I search for the reverse dependencies (another package that may have installed dvips) using apt-cache:因此,我使用 apt-cache 搜索反向依赖项(另一个可能已安装 dvips 的 package):

apt-cache search dvips

and got a list.并得到了一份清单。 And successfully removed them all.并成功将它们全部删除。

But doing Step 1 and 2 above, trying to remove dvips, still doesn't work, and dvips is still installed.但是做了上面的第1步和第2步,尝试删除dvips,还是不行,dvips还是安装了。

I would do:我会做:

$ dpkg -S $(which dvips)

And that should tell you the package that contains dvips.这应该会告诉您包含 dvips 的 package。

You can from there use apt remove or dpkg --remove to remove the package您可以从那里使用 apt remove 或dpkg --remove删除 package

Some of the reasons that come to mind for this to happen are:出现这种情况的一些原因是:

  • the command being part of a package named very differently该命令是 package 的一部分,名称非常不同
  • the package being installed outside of apt. package 安装在 apt 外部。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM