我怎样才能“清理门户”以便 dpkg -l 不再列出我已删除的软件包?

我怎样才能“清理门户”以便 dpkg -l 不再列出我已删除的软件包?

作为解决方案另一个问题我被迫使用dpkg --remove来卸载软件包。但是,在我这样做之后,该软件包仍然列在dpkg -l

phrogz@planar:/boot$ dpkg -l | grep linux-image-2
ii  linux-image-2.6.32-30-server  2.6.32-30.59  Linux kernel image for version 2.6.32 on x86
ii  linux-image-2.6.32-31-server  2.6.32-31.61  Linux kernel image for version 2.6.32 on x86
ii  linux-image-2.6.32-32-server  2.6.32-32.62  Linux kernel image for version 2.6.32 on x86

phrogz@planar:/boot$ sudo dpkg --remove linux-image-2.6.32-30-server
(Reading database ... 141902 files and directories currently installed.)
Removing linux-image-2.6.32-30-server ...
Running postrm hook script /usr/sbin/update-grub.
Generating grub.cfg ...
[...]
done

phrogz@planar:/boot$ dpkg -l | grep linux-image-2
rc  linux-image-2.6.32-30-server  2.6.32-30.59  Linux kernel image for version 2.6.32 on x86
ii  linux-image-2.6.32-31-server  2.6.32-31.61  Linux kernel image for version 2.6.32 on x86
ii  linux-image-2.6.32-32-server  2.6.32-32.62  Linux kernel image for version 2.6.32 on x86

phrogz@planar:/boot$ sudo apt-get --purge remove linux-image-2.6.32-30-server
Reading package lists... Done
Building dependency tree       
Reading state information... Done
Package linux-image-2.6.32-30-server is not installed, so not removed
0 upgraded, 0 newly installed, 0 to remove and 0 not upgraded.

我怎样才能“清理门户”以便dpkg-l不再列出这些旧的、不存在的包裹?

答案1

跑步

sudo dpkg --purge <package>

或者

sudo apt-get purge <package>

卸载<包>及其配置文件。

相关内容