如何将“未完全安装”的 apt-get 软件包标记为“已成功安装”

如何将“未完全安装”的 apt-get 软件包标记为“已成功安装”

我已在 Iomega ix2-200 NAS 上安装了 Debian 7.4,如下这个博客ix2-200 运行 ARM Marvel CPU,并具有 128 MB NAND 闪存。闪存包含 initramfs 映像 (uInitrd) 和内核映像 (uImage),用于启动系统。

有时,新软件包(如cryptsetup)需要更新内核并失败(Unsupported platform)。我需要手动刷新新的 initramfsinitrd.img-3.2.0-4-kirkwood和内核,这工作正常。vmlinuzmkimage

(烦人的)问题:每次我运行apt-get upgrade系统时都会显示那些未完成的包。我如何告诉我的系统一切都很好?

我尝试过 Google 和 StackExchange,但大多数帖子都在讨论如何删除那些未完成/不完整的包。我想保留它!

请参阅随附的代码快照:

#> apt-get install cryptsetup
Reading package lists... Done
Building dependency tree
Reading state information... Done
The following extra packages will be installed:
  console-setup console-setup-linux cryptsetup-bin kbd keyboard-configuration libcryptsetup4 xkb-data
Suggested packages:
  dosfstools
The following NEW packages will be installed:
  console-setup console-setup-linux cryptsetup cryptsetup-bin kbd keyboard-configuration libcryptsetup4 xkb-data
0 upgraded, 8 newly installed, 0 to remove and 0 not upgraded.
Need to get 3,179 kB of archives.
After this operation, 11.8 MB of additional disk space will be used.
Do you want to continue [Y/n]? y

...

Processing triggers for initramfs-tools ...
update-initramfs: Generating /boot/initrd.img-3.2.0-4-kirkwood
Unsupported platform.
run-parts: /etc/initramfs/post-update.d//flash-kernel exited with return code 1
dpkg: error processing initramfs-tools (--configure):
 subprocess installed post-installation script returned error exit status 1
Errors were encountered while processing:
 initramfs-tools
E: Sub-process /usr/bin/dpkg returned an error code (1)

#> apt-get upgrade
Reading package lists... Done
Building dependency tree
Reading state information... Done
0 upgraded, 0 newly installed, 0 to remove and 0 not upgraded.
1 not fully installed or removed.
After this operation, 0 B of additional disk space will be used.
Do you want to continue [Y/n]?

答案1

仅当您知道自己在做什么时,您才可以手动告诉 dpkg 该软件包已安装。

您可以编辑 /var/lib/dpkg/status 文件中的软件包条目:设置状态行“Status: okInstalled”(如果您不想下次自动升级,则设置“Status:hold okinstalled”)。

答案2

您应该进行修复/etc/initramfs/post-update.d/flash-kernel,以便它成功刷新您的内核和 initrd。它位于 /etc 中,因此您可以自由编辑它以使其在您的主板上运行。

如果您无法编辑它以使其工作(例如,刷新是通过 JTAG 完成的),那么您应该让它打印出一个大警告,提醒您刷新它,并且exit 0.

一旦你修复了它,那么你就可以运行了dpkg --configure -a

相关内容