錯誤 initramfs-tools

系统安装、升级讨论
版面规则
我们都知道新人的确很菜,也喜欢抱怨,并且带有浓厚的Windows习惯,但既然在这里询问,我们就应该有责任帮助他们解决问题,而不是直接泼冷水、简单的否定或发表对解决问题没有任何帮助的帖子。乐于分享,以人为本,这正是Ubuntu的精神所在。
回复
寺島聰子
帖子: 688
注册时间: 2016-06-03 14:39
系统: debian11 mate

錯誤 initramfs-tools

#1

帖子 寺島聰子 » 2022-12-14 23:27

$ sudo dpkg --configure initramfs-tools
dpkg: パッケージ initramfs-tools の処理中にエラーが発生しました (--configure):
パッケージ initramfs-tools はすでにインストールおよび設定されています
処理中にエラーが発生しました:
initramfs-tools

$
寺島聰子
帖子: 688
注册时间: 2016-06-03 14:39
系统: debian11 mate

Re: 錯誤 initramfs-tools

#2

帖子 寺島聰子 » 2022-12-16 23:01

apt 使用すると
$ sudo apt purge --auto-remove mate-applet-brisk-menu

update-initramfs: Generating /boot/initrd.img-5.10.0-18-amd64
E: /usr/share/initramfs-tools/hooks/plymouth failed with return 1.  
update-initramfs: failed for /boot/initrd.img-5.10.0-18-amd64 with 1.
dpkg: パッケージ initramfs-tools の処理中にエラーが発生しました (--config
ure):
installed initramfs-tools package post-installation script subprocess re <----この一文を検索
turned error exit status 1
処理中にエラーが発生しました:
initramfs-tools
E: Sub-process /usr/bin/dpkg returned an error code (1)
$
参考
https://qiita.com/yukari-n/items/d1b17bd37036f120153c

原因を探る
sudo dpkg --audit

$ LC_ALL=C sudo dpkg --audit
The following packages are only half configured, probably due to problems
configuring them the first time. The configuration should be retried using
dpkg --configure <package> or the configure menu option in dselect:
initramfs-tools generic modular initramfs generator (automation)
以下のパッケージは最初の設定中に問題が発生したため、設定が終了していません。
dpkg --configure <パッケージ> か dselect で設定 (configure) メニューオプショ
ンを使って設定作業を再試行しなければなりません:
$ sudo dpkg --configure initramfs-tools
initramfs-tools (0.140) を設定しています ...
update-initramfs: deferring update (trigger activated)
initramfs-tools (0.140) のトリガを処理しています ...
update-initramfs: Generating /boot/initrd.img-5.10.0-18-amd64
E: /usr/share/initramfs-tools/hooks/plymouth failed with return 1.
update-initramfs: failed for /boot/initrd.img-5.10.0-18-amd64 with 1.
dpkg: パッケージ initramfs-tools の処理中にエラーが発生しました (--configure):

installed initramfs-tools package post-installation script subprocess returned error exit status 1
処理中にエラーが発生しました:
initramfs-tools

■ /var/lib/dpkg/info/initramfs-tools.postinst が、パッケージをインストールしたあとの設定スクリプトです。そのスクリプトを sh -x などの方法でdebugして失敗している場所を調べて見てください。
/var/lib/dpkg/info/initramfs-tools.postinst是安装软件包后的配置脚本。请检查以sh-x等方式调试脚本失败的位置。
<==自分にとって意味不明のアドバイスだがとにかく実行。对自己来说是意义不明的建议,总之要实行。

$ sh -x /var/lib/dpkg/info/initramfs-tools.postinst
+ set -e
+ mvverbose=-v
+ [ = configure ]
+ [ x != xtriggered ]
+ update-initramfs -u
/var/lib/dpkg/info/initramfs-tools.postinst: 41: update-initramfs: not found

$
次は何をしたら よろしいでしょうか?
寺島聰子
帖子: 688
注册时间: 2016-06-03 14:39
系统: debian11 mate

Re: 錯誤 initramfs-tools

#3

帖子 寺島聰子 » 2022-12-17 0:57

"root"権限が必要

# sh -x /var/lib/dpkg/info/initramfs-tools.postinst
+ set -e
+ mvverbose=-v
+ [ = configure ]
+ [ x != xtriggered ]

+ update-initramfs -u
update-initramfs: Generating /boot/initrd.img-5.10.0-18-amd64
E: /usr/share/initramfs-tools/hooks/plymouth failed with return 1.
update-initramfs: failed for /boot/initrd.img-5.10.0-18-amd64 with 1.
:Effort
寺島聰子
帖子: 688
注册时间: 2016-06-03 14:39
系统: debian11 mate

Re: 錯誤 initramfs-tools

#4

帖子 寺島聰子 » 2022-12-18 9:00

E: /usr/share/initramfs-tools/hooks/plymouth failed with return 1.

を見るに
https://bugs.launchpad.net/ubuntu/+sour ... nty!%20%3A)
$ sudo apt purge --reinstall plymouth
以下のパッケージは「削除」されます:
plymouth* plymouth-label* plymouth-theme-hamara* plymouth-themes*
plymouth-x11*
アップグレード: 0 個、新規インストール: 0 個、削除: 5 個、保留: 2 個。
1 個のパッケージが完全にインストールまたは削除されていません。
この操作後に 2,477 kB のディスク容量が解放されます。
続行しますか? [Y/n] y

initramfs-tools (0.140) のトリガを処理しています ...
update-initramfs: Generating /boot/initrd.img-5.10.0-18-amd64
I: The initramfs will attempt to resume from /dev/sda3
I: (UUID=9e3fed8d-9f31-4fb9-a09a-68b250a63353)
I: Set the RESUME variable to override this.

$ sudo apt purge --auto-remove mate-applet-brisk-menu
以下のパッケージは「削除」されます:
mate-applet-brisk-menu*
------------------------------------------------------------------------------
(データベースを読み込んでいます ... 現在 123874 個のファイルとディレクトリがイン
ストールされています。)
mate-applet-brisk-menu (0.6.2-1) を削除しています ...
libglib2.0-0:amd64 (2.66.8-1) のトリガを処理しています ...
libglib2.0-0:i386 (2.66.8-1) のトリガを処理しています ...
hicolor-icon-theme (0.17-2) のトリガを処理しています ...

$
E: /usr/share/initramfs-tools/hooks/plymouth failed with return 1.

このエラーは消えました!这个错误已经消失了! :Haha
しかしまだ以下のエラーは残ります
$ LC_ALL=C sudo dpkg --configure initramfs-tools
dpkg: error processing package initramfs-tools (--configure):
package initramfs-tools is already installed and configured
Errors were encountered while processing:
initramfs-tools

$
寺島聰子
帖子: 688
注册时间: 2016-06-03 14:39
系统: debian11 mate

Re: 錯誤 initramfs-tools

#5

帖子 寺島聰子 » 2022-12-20 1:17

/var/lib/dpkg/info/initramfs-tools.postinst是安装软件包后的配置脚本。请检查以sh-x等方式调试脚本失败的位置。
$ sh -xv /var/lib/dpkg/info/initramfs-tools.postinst
#!/bin/sh -x

set -e
+ set -e

mvverbose=-v
+ mvverbose=-v

# from dpkg-maintscript-helper, modified
ensure_package_owns_file() {
local PACKAGE="$1"
local FILE="$2"

dpkg-query -L "$PACKAGE" | grep -F -q -x "$FILE"
}

# from dpkg-maintscript-helper, modified
finish_mv_conffile() {
local CONFFILE="$1"
local PACKAGE="$2"

rm $mvverbose -f "$CONFFILE.dpkg-remove"

[ -e "$CONFFILE.dpkg-backup" ] || return 0
ensure_package_owns_file "$PACKAGE" "$CONFFILE" || return 0

echo "Preserving user changes to $CONFFILE (now owned by $PACKAGE)..."
if [ -e "$CONFFILE" ]; then
mv $mvverbose -f "$CONFFILE" "$CONFFILE.dpkg-new"
fi
mv $mvverbose -f "$CONFFILE.dpkg-backup" "$CONFFILE"
}

# If initramfs-tools-core was fully upgraded to 0.123 before our
# preinst ran, we need to move initramfs.conf back into place.
if [ "$1" = configure ] && [ -n "$2" ] && dpkg --compare-versions "$2" lt 0.123~; then
finish_mv_conffile /etc/initramfs-tools/initramfs.conf initramfs-tools-core
fi
+ [ = configure ]

# Regenerate initramfs whenever we go to dpkg state `installed'
if [ "x$1" != xtriggered ]; then
# this activates the trigger, if triggers are working
update-initramfs -u
else
# force it to actually happen
DPKG_MAINTSCRIPT_PACKAGE='' update-initramfs -u
fi
+ [ x != xtriggered ]
+ update-initramfs -u
/var/lib/dpkg/info/initramfs-tools.postinst: 41: update-initramfs: not found
$
debugして失敗している場所はどこでしょう?
回复