update-initramfs: /boot/initrd.img-4.15.0-112-generic が値 1 で失敗しました。

update-initramfs: /boot/initrd.img-4.15.0-112-generic が値 1 で失敗しました。

説明する:

dist-upgradeを実行すると、次の詳細に問題があります。

1 not fully installed or removed.
After this operation, 0 B of additional disk space will be used.
perl: warning: Setting locale failed.
perl: warning: Please check that your locale settings:
    LANGUAGE = "en_US:",
    LC_ALL = (unset),
    LC_CTYPE = "UTF-8",
    LC_TERMINAL = "iTerm2",
    LANG = "en_US.UTF-8"
    are supported and installed on your system.
perl: warning: Falling back to a fallback locale ("en_US.UTF-8").
locale: Cannot set LC_CTYPE to default locale: No such file or directory
locale: Cannot set LC_ALL to default locale: No such file or directory
Setting up initramfs-tools (0.136ubuntu6.6) ...
update-initramfs: deferring update (trigger activated)
Processing triggers for initramfs-tools (0.136ubuntu6.6) ...
update-initramfs: Generating /boot/initrd.img-4.15.0-112-generic
W: Possible missing firmware /lib/firmware/ast_dp501_fw.bin for module ast
Error 24 : Write error : cannot write compressed block
E: mkinitramfs failure lz4 -9 -l 24
update-initramfs: failed for /boot/initrd.img-4.15.0-112-generic with 1.
dpkg: error processing package initramfs-tools (--configure):
 installed initramfs-tools package post-installation script subprocess returned error exit status 1
Errors were encountered while processing:
 initramfs-tools
E: Sub-process /usr/bin/dpkg returned an error code (1)

誰でもこの問題を解決できますか?

ベストアンサー1

すべての出力に隠された実際のエラーメッセージは、Write error : cannot write compressed block新しいinitramfsイメージを作成するために使用できる空き領域が不足しているため、圧倒的に発生します。圧縮されていない画像を受け入れて圧縮バージョンに置き換えるには、フォルダに十分なスペースが必要であることに注意してください/boot。しかし、lz4圧縮アルゴリズムを使用しているので、サイズの違いは大きくないかもしれません(20%未満のようです。私)。

問題を改善する方法はいくつかあります。 /bootディレクトリを詳細に調べ、安全に再配置/削除できる項目を見つけることに加えて、これが最初のアプローチである必要があります。

  1. 新しいinitrdファイルを作成するのに十分な空き容量が足りない場合は、システムに削除できる古いカーネルパッケージがあることを確認し、そのinitrdファイルを使用する必要があります。ターミナルエミュレータを実行して出力を調べて、dpkg --list | grep '^linux-'現在起動しているカーネルと一致しないバージョン文字列を見つけたら、その出力でそれをすばやく確認できますuname -r。この基準を満たすパッケージがいくつかあり、パッケージの更新を正常に完了するためにそれらを破棄する場合は、後でそのパッケージ名を引数として指定するだけですsudo dpkg --purge
  2. 実行中のカーネルバージョンのパッケージのみがインストールされている場合は、現在のinitrdファイルを/ bootディレクトリから再配置してパッケージの更新を実行できることを確認できます。これはもちろん、新しいカーネルバージョンのShinyを使用するのに役立ちます。 initramfsを使用すると、再配置された古いinitramfsを安全に削除できます。使用しているシェルインスタンスの作業ディレクトリが/bootとは異なるファイルシステムにあると仮定すると、次のようになりcdますcd /tmp。を実行します。
# This'll provide a useful report of the files that get moved incase the package
# update fails and you need to put them back where you found them
sudo mv -iv /boot/*initrd "$(pwd)"

# Now time to do a little housekeeping on the package manager and see if
# the update will complete successfully
sudo apt autoremove
sudo apt autoclean
sudo apt --fix-broken install
sudo dpkg --configure -a

それでも同じエラーが発生し、空き領域の問題が解決されたと確信している場合は、現在システムに存在するinitramfs-toolsパッケージに実際に問題があると結論付けることができるので、インポートしてください。次のコマンドを使用してシーケンスを元の状態に復元します。

sudo apt remove initramfs-tools
sudo apt clean
sudo apt -y install initramfs-tools

おすすめ記事