![initramfs-tools 中的错误](https://linux22.com/image/1020567/initramfs-tools%20%E4%B8%AD%E7%9A%84%E9%94%99%E8%AF%AF.png)
大约一周以来,我在更新或运行任何 apt 命令时都遇到了错误。升级到 LTS 18.04 并没有解决这个问题,删除所有旧内核也没有解决这个问题。空间也不是问题。
尝试重新安装 initramfs 不起作用。我得到的错误是:
Setting up initramfs-tools (0.136ubuntu6.3) ...
update-initramfs: deferring update (trigger activated)
Processing triggers for initramfs-tools (0.136ubuntu6.3) ...
update-initramfs: Generating /boot/initrd.img-5.4.0-52-generic
E: /usr/share/initramfs-tools/hooks/plymouth failed with return 1.
update-initramfs: failed for /boot/initrd.img-5.4.0-52-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:
编辑:后来(2022 年 4 月)对该问题进行了补充。
这不适合我的系统,但根据我的搜索,这或多或少是 1. 命中。
initramfs-tools:
Installiert: 0.136ubuntu6.7
Installationskandidat: 0.136ubuntu6.7
Versionstabelle:
*** 0.136ubuntu6.7 500
500 http://archive.ubuntu.com/ubuntu focal-updates/main amd64 Packages
500 http://archive.ubuntu.com/ubuntu focal-updates/main i386 Packages
100 /var/lib/dpkg/status
0.136ubuntu6 500
500 http://archive.ubuntu.com/ubuntu focal/main amd64 Packages
500 http://archive.ubuntu.com/ubuntu focal/main i386 Packages
我们使用 wget fresh 提取该包并尝试将其与plymouth 包一起initramfs-tools
安装。dpkg
$ sudo dpkg -i initramfs-tools_0.136ubuntu6.7_all.deb
(Lese Datenbank ... 548002 Dateien und Verzeichnisse sind derzeit installiert.)
Vorbereitung zum Entpacken von initramfs-tools_0.136ubuntu6.7_all.deb ...
Entpacken von initramfs-tools (0.136ubuntu6.7) über (0.136ubuntu6.7) ...
initramfs-tools (0.136ubuntu6.7) wird eingerichtet ...
update-initramfs: deferring update (trigger activated)
Trigger für man-db (2.9.1-1) werden verarbeitet ...
Trigger für initramfs-tools (0.136ubuntu6.7) werden verarbeitet ...
update-initramfs: Generating /boot/initrd.img-5.4.0-109-generic
E: /usr/share/initramfs-tools/hooks/plymouth failed with return 1.
update-initramfs: failed for /boot/initrd.img-5.4.0-109-generic with 1.
dpkg: Fehler beim Bearbeiten des Paketes initramfs-tools (--install):
»installiertes initramfs-tools-Skript des Paketes post-installation«-Unterprozess gab den Fehlerwert 1 zurück
Fehler traten auf beim Bearbeiten von:
initramfs-tools
然后我们尝试获取更多信息
$ dash -x /usr/share/initramfs-tools/hooks/plymouth
+ set -e
+ OPTION=FRAMEBUFFER
+ PREREQ=
+ . /usr/share/initramfs-tools/hook-functions
+ update-alternatives --query default.plymouth
+ sed -e /^Value:/!d -e s/^Value: \(.*\)/\1/
+ THEME_PATH=/usr/share/plymouth/themes/mint-logo/mint-logo.plymouth
+ basename /usr/share/plymouth/themes/mint-logo/mint-logo.plymouth .plymouth
+ THEME=mint-logo
+ THEMES=/usr/share/plymouth/themes
+ [ -n /usr/share/plymouth/themes/mint-logo/mint-logo.plymouth ]
+ grep ImageDir *= * /usr/share/plymouth/themes/mint-logo/mint-logo.plymouth
+ sed s/ImageDir *= *//
+ IMAGE_PATH=/usr/share/plymouth/themes/mint-logo
+ [ -n /usr/share/plymouth/themes/mint-logo ]
+ [ /usr/share/plymouth/themes/mint-logo/mint-logo.plymouth != /usr/share/plymouth/themes/mint-logo ]
+ basename /usr/share/plymouth/themes/mint-logo
+ IMAGE_NAME=mint-logo
+ mkdir -p //usr/share/plymouth/themes
+ [ -n mint-logo ]
+ [ mint-logo != none ]
+ THEME_NAME=mint-logo
+ THEME=/usr/share/plymouth/themes/mint-logo/mint-logo.plymouth
+ ln -s /usr/share/plymouth/themes/mint-logo/mint-logo.plymouth //usr/share/plymouth/themes/default.plymouth
ln: Die symbolische Verknüpfung '//usr/share/plymouth/themes/default.plymouth' konnte nicht angelegt werden: Die Datei existiert bereits
然后我检查了一下它是全新的。但悬赏已经太晚了。:(
我检查了一些链接
$ ls -al /usr/share/plymouth/themes/default.plymouth
lrwxrwxrwx 1 root root 55 Apr 27 14:40 /usr/share/plymouth/themes/default.plymouth -> /usr/share/plymouth/themes/mint-logo/mint-logo.plymouth
和
$ update-alternatives --query text.plymouth
Name: text.plymouth
Link: /usr/share/plymouth/themes/text.plymouth
Status: auto
Best: /usr/share/plymouth/themes/mint-text/mint-text.plymouth
Value: /usr/share/plymouth/themes/mint-text/mint-text.plymouth
Alternative: /usr/share/plymouth/themes/mint-text/mint-text.plymouth
Priority: 200
Alternative: /usr/share/plymouth/themes/text/text.plymouth
Priority: 40
Alternative: /usr/share/plymouth/themes/ubuntu-text/ubuntu-text.plymouth
Priority: 50
和
$ update-alternatives --query default.plymouth
Name: default.plymouth
Link: /usr/share/plymouth/themes/default.plymouth
Status: auto
Best: /usr/share/plymouth/themes/mint-logo/mint-logo.plymouth
Value: /usr/share/plymouth/themes/mint-logo/mint-logo.plymouth
Alternative: /usr/share/plymouth/themes/bgrt/bgrt.plymouth
Priority: 110
Alternative: /usr/share/plymouth/themes/mint-logo-legacy/mint-logo-legacy.plymouth
Priority: 100
Alternative: /usr/share/plymouth/themes/mint-logo/mint-logo.plymouth
Priority: 200
Alternative: /usr/share/plymouth/themes/spinner/spinner.plymouth
Priority: 70
我检查了链接/usr/share/plymouth/themes
并纠正了主题:
$ ls -al /usr/share/plymouth/themes
insgesamt 104
drwxr-xr-x 22 root root 4096 Apr 27 16:33 .
drwxr-xr-x 3 root root 4096 Apr 27 13:38 ..
drwxr-xr-x 2 root root 4096 Apr 27 13:38 bgrt
lrwxrwxrwx 1 root root 40 Aug 28 2019 debian-theme -> ../../desktop-base/active-theme/plymouth #this one I let unlink too
lrwxrwxrwx 1 root root 34 Apr 27 16:33 default.plymouth -> /etc/alternatives/default.plymouth
drwxr-xr-x 2 root root 4096 Apr 27 13:38 details
drwxr-xr-x 2 root root 4096 Apr 27 13:38 fade-in
drwxr-xr-x 2 root root 4096 Mai 12 2021 futureprototype
drwxr-xr-x 2 root root 12288 Apr 27 13:38 glow
drwxr-xr-x 2 root root 4096 Mai 12 2021 joy
drwxr-xr-x 2 root root 4096 Mai 12 2021 lines
drwxr-xr-x 2 root root 4096 Jan 14 15:46 mint-logo
drwxr-xr-x 2 root root 4096 Jan 14 15:46 mint-logo-legacy
drwxr-xr-x 2 root root 4096 Jan 14 15:46 mint-text
drwxr-xr-x 2 root root 4096 Mai 12 2021 moonlight
drwxr-xr-x 2 root root 4096 Apr 27 13:38 script
drwxr-xr-x 2 root root 4096 Mai 12 2021 softwaves
drwxr-xr-x 2 root root 4096 Apr 27 13:38 solar
drwxr-xr-x 2 root root 4096 Mai 12 2021 spacefun
drwxr-xr-x 2 root root 4096 Apr 27 13:38 spinfinity
drwxr-xr-x 2 root root 12288 Apr 27 13:38 spinner
drwxr-xr-x 2 root root 4096 Apr 27 13:38 text
lrwxrwxrwx 1 root root 31 Apr 27 16:33 text.plymouth -> /etc/alternatives/text.plymouth
drwxr-xr-x 2 root root 4096 Apr 27 13:38 tribar
drwxr-xr-x 2 root root 4096 Apr 27 13:38 ubuntu-text
我又尝试重命名/usr/share/initramfs-tools/hooks/plymouth
并解压了 plymouth 包来替换它:
$ sudo update-initramfs -v -u -k $(uname -r)
输出太长,发布在调试模式。我没有看到错误,但也许我错了。
sudo inxi -SMG
System: Host: xxx Kernel: 5.4.0-109-generic x86_64 bits: 64 Console: tty 1 Distro: Linux Mint 20.2 Uma
Machine: Type: Desktop System: Gigabyte product: Z97X-UD3H v: N/A serial: N/A
Mobo: Gigabyte model: Z97X-UD3H-CF v: x.x serial: N/A UEFI: American Megatrends v: F7 date: 06/17/2014
Graphics: Device-1: Intel Xeon E3-1200 v3/4th Gen Core Processor Integrated Graphics driver: i915 v: kernel
Device-2: NVIDIA GP104 [GeForce GTX 1070] driver: nvidia v: 470.103.01
Display: server: X.org 1.20.13 driver: modesetting,nvidia unloaded: fbdev,nouveau,vesa tty: 212x58
Message: Advanced graphics data unavailable in console for root.
注意:nvidia 模块已正确构建并安装在正在运行的内核中。在日志中,我发现
kernel: [drm] Initialized i915 1.6.0 20190822 for 0000:00:02.0 on minor 0
Mai 03 08:40:08 xxx kernel: [drm] Cannot find any crtc or sizes
apt-cache policy initramfs-tools
initramfs-tools:
Installiert: 0.136ubuntu6.7
Installationskandidat: 0.136ubuntu6.7
Versionstabelle:
*** 0.136ubuntu6.7 500
500 http://archive.ubuntu.com/ubuntu focal-updates/main amd64 Packages
500 http://archive.ubuntu.com/ubuntu focal-updates/main i386 Packages
100 /var/lib/dpkg/status
0.136ubuntu6 500
500 http://archive.ubuntu.com/ubuntu focal/main amd64 Packages
500 http://archive.ubuntu.com/ubuntu focal/main i386 Packages
答案1
最初的问题已经过时了。
最近调查中增加了一项(悬赏),系统可能不匹配。细微差别可能会造成差异,因此了解它们很重要。
此外,还有先前的帖子措辞完全相同,令人瞩目。
由于关于感兴趣系统的信息有限,可能的解决方案来自发布以上内容这是套装吗
$ sudo apt autoremove
$ sudo apt clean
$ sudo apt update
$ sudo apt upgrade
您可以检查其他解决方案,它们提供了替代(子)集
$ sudo apt remove initramfs-tools
$ sudo apt clean
$ sudo apt install initramfs-tools
$ sudo apt autoremove
$ sudo apt autoclean
$ sudo apt clean
$ sudo apt update
$ sudo apt upgrade
$ sudo apt dist-upgrade
$ sudo apt -f install
$ sudo dpkg --configure -a
如需进一步解决方案,请发帖在原帖中
输出
$ uname -a $ lsb_release -a $ sudo inxi -SM $ dpkg -l | grep initramfs-tools
你的硬盘加密了吗?
有关的: