Убедительно прошу кого-нибудь опытного помочь мне в следующем болезненном вопросе. Недавно мое автоматическое средство обновления программного обеспечения предложило мне обновить linux-firmware. Обновление не удалось, и с тех пор я получаю такое сообщение при каждом обновлении. Я пытался найти решения Google и исправить проблему, но мне это не удалось. Вот краткое изложение того, что я пробовал:

Вот что я получаю после выполнения sudo apt install linux-firmware:

$ sudo apt install linux-firmware
Reading package lists... Done
Building dependency tree       
Reading state information... Done
linux-firmware is already the newest version (1.187.24).
0 upgraded, 0 newly installed, 0 to remove and 0 not upgraded.
6 not fully installed or removed.
After this operation, 0 B of additional disk space will be used.
Do you want to continue? [Y/n] Y
Setting up initramfs-tools (0.136ubuntu6.6) ...
update-initramfs: deferring update (trigger activated)
Setting up linux-firmware (1.187.24) ...
update-initramfs: Generating /boot/initrd.img-5.4.0-91-generic
I: The initramfs will attempt to resume from /dev/dm-2
I: (/dev/mapper/kubuntu--vg-swap_1)
I: Set the RESUME variable to override this.
Error 24 : Write error : cannot write compressed block 
E: mkinitramfs failure cpio 141 lz4 -9 -l 24
update-initramfs: failed for /boot/initrd.img-5.4.0-91-generic with 1.
dpkg: error processing package linux-firmware (--configure):
 installed linux-firmware package post-installation script subprocess returned error exit status 1
Setting up linux-image-5.4.0-92-generic (5.4.0-92.103) ...
dpkg: dependency problems prevent configuration of linux-image-generic:
 linux-image-generic depends on linux-firmware; however:
  Package linux-firmware is not configured yet.

dpkg: error processing package linux-image-generic (--configure):
 dependency problems - leaving unconfigured
dpkg: dependency problems prevent configuration of linux-generic:
 linux-generic depends on linux-image-generic (= 5.4.0.92.96); however:
  Package linux-image-generic is not configured yet.

dpkg: error processing package linux-generic (--configure):
 dependency problems - leaving unconfigured
No apport report written because the error message indicates its a followup error from a previous failure.
                                                                                                          No apport report written because the error message indicates its a followup error from a previous failure.
                       No apport report written because MaxReports is reached already
                                                                                     dpkg: dependency problems prevent configuration of linux-generic-hwe-18.04:
 linux-generic-hwe-18.04 depends on linux-generic; however:
  Package linux-generic is not configured yet.

dpkg: error processing package linux-generic-hwe-18.04 (--configure):
 dependency problems - leaving unconfigured
Processing triggers for initramfs-tools (0.136ubuntu6.6) ...
update-initramfs: Generating /boot/initrd.img-5.4.0-91-generic
I: The initramfs will attempt to resume from /dev/dm-2
I: (/dev/mapper/kubuntu--vg-swap_1)
I: Set the RESUME variable to override this.
Error 24 : Write error : cannot write compressed block 
E: mkinitramfs failure cpio 141 lz4 -9 -l 24
update-initramfs: failed for /boot/initrd.img-5.4.0-91-generic with 1.
dpkg: error processing package initramfs-tools (--configure):
 installed initramfs-tools package post-installation script subprocess returned error exit status 1
No apport report written because MaxReports is reached already
                                                              Processing triggers for linux-image-5.4.0-92-generic (5.4.0-92.103) ...
/etc/kernel/postinst.d/initramfs-tools:
update-initramfs: Generating /boot/initrd.img-5.4.0-92-generic
I: The initramfs will attempt to resume from /dev/dm-2
I: (/dev/mapper/kubuntu--vg-swap_1)
I: Set the RESUME variable to override this.
Error 24 : Write error : cannot write compressed block 
E: mkinitramfs failure cpio 141 lz4 -9 -l 24
update-initramfs: failed for /boot/initrd.img-5.4.0-92-generic with 1.
run-parts: /etc/kernel/postinst.d/initramfs-tools exited with return code 1
dpkg: error processing package linux-image-5.4.0-92-generic (--configure):
 installed linux-image-5.4.0-92-generic package post-installation script subprocess returned error exit status 1
No apport report written because MaxReports is reached already
                                                              Errors were encountered while processing:
 linux-firmware
 linux-image-generic
 linux-generic
 linux-generic-hwe-18.04
 initramfs-tools
 linux-image-5.4.0-92-generic
E: Sub-process /usr/bin/dpkg returned an error code (1)

Вот результат, который я получаю, когда пытаюсь sudo dpkg --configure -a:

$ sudo dpkg --configure -a                       
dpkg: dependency problems prevent configuration of linux-image-generic:
 linux-image-generic depends on linux-image-5.4.0-92-generic; however:
  Package linux-image-5.4.0-92-generic is not configured yet.

dpkg: error processing package linux-image-generic (--configure):
 dependency problems - leaving unconfigured
Setting up initramfs-tools (0.136ubuntu6.6) ...
update-initramfs: deferring update (trigger activated)
dpkg: dependency problems prevent configuration of linux-generic:
 linux-generic depends on linux-image-generic (= 5.4.0.92.96); however:
  Package linux-image-generic is not configured yet.

dpkg: error processing package linux-generic (--configure):
 dependency problems - leaving unconfigured
Setting up linux-firmware (1.187.24) ...
update-initramfs: Generating /boot/initrd.img-5.4.0-91-generic
I: The initramfs will attempt to resume from /dev/dm-2
I: (/dev/mapper/kubuntu--vg-swap_1)
I: Set the RESUME variable to override this.
Error 24 : Write error : cannot write compressed block 
E: mkinitramfs failure cpio 141 lz4 -9 -l 24
update-initramfs: failed for /boot/initrd.img-5.4.0-91-generic with 1.
dpkg: error processing package linux-firmware (--configure):
 installed linux-firmware package post-installation script subprocess returned error exit status 1
dpkg: dependency problems prevent configuration of linux-generic-hwe-18.04:
 linux-generic-hwe-18.04 depends on linux-generic; however:
  Package linux-generic is not configured yet.

dpkg: error processing package linux-generic-hwe-18.04 (--configure):
 dependency problems - leaving unconfigured
Processing triggers for initramfs-tools (0.136ubuntu6.6) ...
update-initramfs: Generating /boot/initrd.img-5.4.0-91-generic
I: The initramfs will attempt to resume from /dev/dm-2
I: (/dev/mapper/kubuntu--vg-swap_1)
I: Set the RESUME variable to override this.
Error 24 : Write error : cannot write compressed block 
E: mkinitramfs failure cpio 141 lz4 -9 -l 24
update-initramfs: failed for /boot/initrd.img-5.4.0-91-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:
 linux-image-generic
 linux-generic
 linux-firmware
 linux-generic-hwe-18.04
 initramfs-tools

Наконец, я также попробовал sudo apt --fix-broken install:

$ sudo apt --fix-broken install                                     
Reading package lists... Done
Building dependency tree       
Reading state information... Done
0 upgraded, 0 newly installed, 0 to remove and 0 not upgraded.
6 not fully installed or removed.
After this operation, 0 B of additional disk space will be used.
Setting up initramfs-tools (0.136ubuntu6.6) ...
update-initramfs: deferring update (trigger activated)
Setting up linux-firmware (1.187.24) ...
update-initramfs: Generating /boot/initrd.img-5.4.0-91-generic
I: The initramfs will attempt to resume from /dev/dm-2
I: (/dev/mapper/kubuntu--vg-swap_1)
I: Set the RESUME variable to override this.
Error 24 : Write error : cannot write compressed block 
E: mkinitramfs failure cpio 141 lz4 -9 -l 24
update-initramfs: failed for /boot/initrd.img-5.4.0-91-generic with 1.
dpkg: error processing package linux-firmware (--configure):
 installed linux-firmware package post-installation script subprocess returned error exit status 1
Setting up linux-image-5.4.0-92-generic (5.4.0-92.103) ...
dpkg: dependency problems prevent configuration of linux-image-generic:
 linux-image-generic depends on linux-firmware; however:
  Package linux-firmware is not configured yet.

dpkg: error processing package linux-image-generic (--configure):
 dependency problems - leaving unconfigured
dpkg: dependency problems prevent configuration of linux-generic:
 linux-generic depends on linux-image-generic (= 5.4.0.92.96); however:
  Package linux-image-generic is not configured yet.

dpkg: error processing package linux-generic (--configure):
 dependency problems - leaving unconfigured
dpkg: dependency problems prevent configuration of linux-generic-hwe-18.04:
 linux-generic-hwe-18.04 depends on linux-generic; however:
  Package linux-generic is not configured yet.

No apport report written because the error message indicates its a followup error from a previous failure.
                                                                                                          No apport report wrrom a previous failure.
                       No apport report written because MaxReports is reached already
                                                                                     dpkg: error processing package linux-gen
 dependency problems - leaving unconfigured
Processing triggers for initramfs-tools (0.136ubuntu6.6) ...
update-initramfs: Generating /boot/initrd.img-5.4.0-91-generic
I: The initramfs will attempt to resume from /dev/dm-2
I: (/dev/mapper/kubuntu--vg-swap_1)
I: Set the RESUME variable to override this.
Error 24 : Write error : cannot write compressed block 
E: mkinitramfs failure cpio 141 lz4 -9 -l 24
update-initramfs: failed for /boot/initrd.img-5.4.0-91-generic with 1.
dpkg: error processing package initramfs-tools (--configure):
 installed initramfs-tools package post-installation script subprocess returned error exit status 1
No apport report written because MaxReports is reached already
                                                              Processing triggers for linux-image-5.4.0-92-generic (5.4.0-92.
/etc/kernel/postinst.d/initramfs-tools:
update-initramfs: Generating /boot/initrd.img-5.4.0-92-generic
I: The initramfs will attempt to resume from /dev/dm-2
I: (/dev/mapper/kubuntu--vg-swap_1)
I: Set the RESUME variable to override this.
Error 24 : Write error : cannot write compressed block 
E: mkinitramfs failure cpio 141 lz4 -9 -l 24
update-initramfs: failed for /boot/initrd.img-5.4.0-92-generic with 1.
run-parts: /etc/kernel/postinst.d/initramfs-tools exited with return code 1
dpkg: error processing package linux-image-5.4.0-92-generic (--configure):
 installed linux-image-5.4.0-92-generic package post-installation script subprocess returned error exit status 1
No apport report written because MaxReports is reached already
                                                              Errors were encountered while processing:
 linux-firmware
 linux-image-generic
 linux-generic
 linux-generic-hwe-18.04
 initramfs-tools
 linux-image-5.4.0-92-generic
E: Sub-process /usr/bin/dpkg returned an error code (1)

Я надеюсь, что кто-то сможет помочь мне с проблемой. Заранее большое спасибо!

1
Luinorn 10 Янв 2022 в 16:43
2
 – 
guiverc
10 Янв 2022 в 13:48
У вас есть 2 метапакета ядра на вашем компьютере, одного должно быть достаточно
 – 
nobody
10 Янв 2022 в 14:32
Прошу прощения за свою неполноту. Моя версия Ubuntu 20.04.3 LTS (Focal Fossa)
 – 
Luinorn
10 Янв 2022 в 16:42
Вас утомил мой ответ? Каков результат? Проблема решена? Статус, пожалуйста :)
 – 
Someone
11 Янв 2022 в 08:52

1 ответ

Лучший ответ

Похоже, какие-то проблемы со старыми ядрами. Давайте работать вместе шаг за шагом, чтобы решить эту проблему.

  1. Во-первых, удалите все старые ядра, которые больше не используются или вызывают ошибки:

     dpkg -l | egrep "linux-(signed|modules|image|headers)" | grep -v $(uname -r | cut -d - -f 1) | awk {'print $2'} | xargs sudo apt purge -y
    
  2. Запустите apt -f еще раз:

    sudo apt --fix-broken install
    

В качестве альтернативы вы можете использовать немного сложный способ сделать то же самое.

  1. Удалите постустановочные файлы для пакетов ошибок и запустите свежее обновление:

     cd /var/lib/dpkg/info/ && sudo mv linux-firmware* ~/ && sudo mv linux-image-generic* ~/ && sudo mv linux-generic* ~/ && sudo mv linux-generic-hwe-18.0* ~/ && sudo mv initramfs-tools* ~/ && sudo mv linux-image-5.4.0-92-generic* ~/
    
  2. Выполнить apt -f

    sudo apt --fix-broken install 
    
  3. Теперь обновите снова:

    sudo apt update && sudo apt upgrade -y
    
  4. Теперь переустановите пакеты:

    sudo apt install linux-firmware linux-image-generic linux-generic linux-generic-hwe-18.04 initramfs-tools linux-image-5.4.0-92-generic
    

Альтернативный способ выполнить описанные выше шаги в одной удобной для копирования и вставки строке.

sudo dpkg --purge --force-all linux-firmware linux-image-generic linux-generic linux-generic-hwe-18.04 initramfs-tools linux-image-5.4.0-92-generic && sudo apt -f install && sudo apt update && sudo apt upgrade  && sudo apt install linux-firmware linux-image-generic linux-generic linux-generic-hwe-18.04 initramfs-tools linux-image-5.4.0-92-generic

Эта проблема была решена в чате. (Если у вас есть какие-либо вопросы по поводу этого ответа, пожалуйста, прокомментируйте здесь. Не продолжайте этот чат.)

1
Someone 11 Янв 2022 в 14:03
Спасибо @Someone за то, что вы так добры и полезны. Однако ни один из методов не сработал. Первый шаг первого рецепта дает ошибки: Package linux-firmware is not configured yet. Package linux-image-generic is not configured yet... и аналогичные Первый шаг второго рецепта дает: $ cd /var/lib/dpkg/info/ && sudo mv linux-firmware* ~/ && sudo mv linux-image-generic* ~/ && sudo mv linux-generic* ~/ && sudo mv linux-generic-hwe-18.0* ~/ && sudo mv initramfs-tools* ~/ && sudo mv linux-image-5.4.0-92-generic* ~/ mv: cannot stat 'linux-firmware*': No such file or directory
 – 
Luinorn
11 Янв 2022 в 11:34
Хм... Можете ли вы предоставить вывод ls /var/lib/dpkg/info/ | grep linux-firmware
 – 
Someone
11 Янв 2022 в 11:46
Пустой. Я вижу там много linux-base*, linux-headers*, linux-image*, linux-libc* и linux-modules*.
 – 
Luinorn
11 Янв 2022 в 12:37
К сожалению, чат блокирует меня сообщением You must have 20 reputation on The Stack Exchange Network to talk here.
 – 
Luinorn
11 Янв 2022 в 12:50
1
Сделанный. Еще раз большое спасибо @Someone. Ты истинный самаритянин!
 – 
Luinorn
11 Янв 2022 в 14:40