Debian

如何將“未完全安裝”apt-get 包標記為“成功安裝”

  • August 30, 2018

按照這個部落格,我已經在我的 Iomega ix2-200 NAS 上安裝了 Debian 7.4 。ix2-200 執行 ARM Marvel CPU 並具有 128 MB NAND 快閃記憶體。快閃記憶體包含用於引導系統的 initramfs 映像 (uInitrd) 和核心映像 (uImage)。

有時,一個新包(如cryptsetup)需要更新核心並失敗(Unsupported platform)。我手動需要通過 刷新新的 initramfs和initrd.img-3.2.0-4-kirkwood核心,這工作正常。vmlinuz``mkimage

(討厭的)問題:每次我執行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]?

您應該修復/etc/initramfs/post-update.d/flash-kernel它以使其成功刷新您的核心和 initrd。它在 /etc 中,因此您可以自由編輯它以使其在您的板上工作。

如果您無法對其進行編輯以使其工作(例如,使用 JTAG 完成閃爍),那麼您應該讓它列印出一個大警告,提醒您對其進行閃爍,並且exit 0.

一旦你修復了它,你就可以執行dpkg --configure -a.

只有當您知道自己在做什麼時,您才能手動告訴 dpkg 該軟體包已安裝。

您可以在 /var/lib/dpkg/status 文件中編輯軟體包條目:設置狀態行“狀態:正常安裝”(如果您不想下次自動升級,則為“狀態:保持正常安裝”)。

引用自:https://unix.stackexchange.com/questions/122992