web-dev-qa-db-ja.com

インストール/更新を妨げる破損したカーネルパッケージ

まず、このトピックに関する他のさまざまな質問と回答を見てきましたが、彼らは私の問題を解決していませんでした。そのため、Googleとここで長い間気を遣うことなく突入しませんでした。また、個別のブートパーティションはなく、十分な空き領域があります。

私は16.04にいますが、アップデートの実行中にラップトップが再起動またはクラッシュしたことが起こったと思います。確かに私がそれに戻ったとき、それは予想外にオフでした、そして今、私はapt-getで何もインストールできません。私が解決策を追求したとき、その時点からの唯一の大きな変更は、どこかで示唆されたようにlinux-genericの削除を強制しようとしたことですが、パッケージの削除には成功しましたが再インストールされませんでした。

現在、私はカーネル4.8.0-54-genericにフォールバックすることができました。これはかなりうまく機能しています(現在ラップトップを使用しています)。

Dpkg --auditから始めます。

The following packages have been unpacked but not yet configured.
They must be configured using dpkg --configure or the configure
menu option in dselect for them to work:
 linux-generic-hwe-16.04 Complete Generic Linux kernel and headers
 linux-image-extra-4.8.0-56-generic Linux kernel extra modules for version 4.8.
 linux-image-extra-4.8.0-58-generic Linux kernel extra modules for version 4.8.
 linux-image-generic-hwe-16.04 Generic Linux kernel image

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:
 linux-image-4.8.0-53-generic Linux kernel image for version 4.8.0 on 64 bit x8
 linux-image-4.8.0-56-generic Linux kernel image for version 4.8.0 on 64 bit x8
 linux-image-4.8.0-58-generic Linux kernel image for version 4.8.0 on 64 bit x8

The following packages are only half installed, due to problems during
installation. The installation can probably be completed by retrying it;
the packages can be removed using dselect or dpkg --remove:
 linux-image-extra-4.4.0-83-generic Linux kernel extra modules for version 4.4.
 linux-image-extra-4.8.0-53-generic Linux kernel extra modules for version 4.8.

for i in /boot/vmlinuz* ; do dpkg -S $i | egrep -v $(uname -r); done |cut -d- -f3-4出力の実行:

4.4.0-53
4.8.0-53
4.8.0-56
4.8.0-58

dpkgは基本的にいくつかの削除を除いて何もしません。したがって、dpkg --configure -aは以下を生成します。

Setting up linux-image-4.8.0-53-generic (4.8.0-53.56~16.04.1) ...
Running depmod.
update-initramfs: deferring update (hook will be called later)
Not updating initrd symbolic links since we are being updated/reinstalled 
(4.8.0-53.56~16.04.1 was configured last, according to dpkg)
Not updating image symbolic links since we are being updated/reinstalled 
(4.8.0-53.56~16.04.1 was configured last, according to dpkg)
Examining /etc/kernel/postinst.d.
run-parts: executing /etc/kernel/postinst.d/apt-auto-removal 4.8.0-53-generic /boot/vmlinuz-4.8.0-53-generic
run-parts: executing /etc/kernel/postinst.d/dkms 4.8.0-53-generic /boot/vmlinuz-4.8.0-53-generic
Error! Your kernel headers for kernel 4.8.0-53-generic cannot be found.
Please install the linux-headers-4.8.0-53-generic package,
or use the --kernelsourcedir option to tell DKMS where it's located
run-parts: executing /etc/kernel/postinst.d/initramfs-tools 4.8.0-53-generic /boot/vmlinuz-4.8.0-53-generic
update-initramfs: Generating /boot/initrd.img-4.8.0-53-generic
cp: cannot stat '/etc/fonts/conf.d/60-latin.conf': No such file or directory
E: /usr/share/initramfs-tools/hooks/plymouth failed with return 1.
update-initramfs: failed for /boot/initrd.img-4.8.0-53-generic with 1.
run-parts: /etc/kernel/postinst.d/initramfs-tools exited with return code 1
Failed to process /etc/kernel/postinst.d at /var/lib/dpkg/info/linux-image-4.8.0-53-generic.postinst line 1052.
dpkg: error processing package linux-image-4.8.0-53-generic (--configure):
 subprocess installed post-installation script returned error exit status 2
Setting up linux-image-4.8.0-58-generic (4.8.0-58.63~16.04.1) ...
Running depmod.
update-initramfs: deferring update (hook will be called later)
The link /initrd.img is a dangling linkto /boot/initrd.img-4.8.0-56-generic
Examining /etc/kernel/postinst.d.
run-parts: executing /etc/kernel/postinst.d/apt-auto-removal 4.8.0-58-generic /boot/vmlinuz-4.8.0-58-generic
run-parts: executing /etc/kernel/postinst.d/dkms 4.8.0-58-generic /boot/vmlinuz-4.8.0-58-generic
run-parts: executing /etc/kernel/postinst.d/initramfs-tools 4.8.0-58-generic /boot/vmlinuz-4.8.0-58-generic
update-initramfs: Generating /boot/initrd.img-4.8.0-58-generic
W: Possible missing firmware /lib/firmware/i915/kbl_dmc_ver1_01.bin for module i915
cp: cannot stat '/etc/fonts/conf.d/60-latin.conf': No such file or directory
E: /usr/share/initramfs-tools/hooks/plymouth failed with return 1.
update-initramfs: failed for /boot/initrd.img-4.8.0-58-generic with 1.
run-parts: /etc/kernel/postinst.d/initramfs-tools exited with return code 1
Failed to process /etc/kernel/postinst.d at /var/lib/dpkg/info/linux-image-4.8.0-58-generic.postinst line 1052.
dpkg: error processing package linux-image-4.8.0-58-generic (--configure):
 subprocess installed post-installation script returned error exit status 2
Setting up linux-image-4.8.0-56-generic (4.8.0-56.61~16.04.1) ...
Running depmod.
update-initramfs: deferring update (hook will be called later)
The link /initrd.img is a dangling linkto /boot/initrd.img-4.8.0-58-generic
Examining /etc/kernel/postinst.d.
run-parts: executing /etc/kernel/postinst.d/apt-auto-removal 4.8.0-56-generic /boot/vmlinuz-4.8.0-56-generic
run-parts: executing /etc/kernel/postinst.d/dkms 4.8.0-56-generic /boot/vmlinuz-4.8.0-56-generic
run-parts: executing /etc/kernel/postinst.d/initramfs-tools 4.8.0-56-generic /boot/vmlinuz-4.8.0-56-generic
update-initramfs: Generating /boot/initrd.img-4.8.0-56-generic
W: Possible missing firmware /lib/firmware/i915/kbl_dmc_ver1_01.bin for module i915
cp: cannot stat '/etc/fonts/conf.d/60-latin.conf': No such file or directory
E: /usr/share/initramfs-tools/hooks/plymouth failed with return 1.
update-initramfs: failed for /boot/initrd.img-4.8.0-56-generic with 1.
run-parts: /etc/kernel/postinst.d/initramfs-tools exited with return code 1
Failed to process /etc/kernel/postinst.d at /var/lib/dpkg/info/linux-image-4.8.0-56-generic.postinst line 1052.
dpkg: error processing package linux-image-4.8.0-56-generic (--configure):
 subprocess installed post-installation script returned error exit status 2
dpkg: dependency problems prevent configuration of linux-image-generic-hwe-16.04:
 linux-image-generic-hwe-16.04 depends on linux-image-4.8.0-58-generic; however:
  Package linux-image-4.8.0-58-generic is not configured yet.

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

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

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

dpkg: error processing package linux-generic-hwe-16.04 (--configure):
 dependency problems - leaving unconfigured
Errors were encountered while processing:
 linux-image-4.8.0-53-generic
 linux-image-4.8.0-58-generic
 linux-image-4.8.0-56-generic
 linux-image-generic-hwe-16.04
 linux-image-extra-4.8.0-58-generic
 linux-image-extra-4.8.0-56-generic
 linux-generic-hwe-16.04

実際に実行されているカーネルとは異なるカーネルのヘッ​​ダーファイルが欠落していることについて文句を言うことに注意してください(-54の代わりに-53、どちらもこの混乱が爆発する前にインストールした最高のカーネルよりもかなり遅れています)。

apt-get -f installの結果:

 Reading package lists... Done
 Building dependency tree       
 Reading state information... Done
 Correcting dependencies... Done
 The following packages were automatically installed and are no longer required:
   linux-headers-4.4.0-83 linux-headers-4.4.0-83-generic linux-image-4.4.0-83-generic linux-image-extra-4.4.0-83-generic
 Use 'Sudo apt autoremove' to remove them.
 The following additional packages will be installed:
   libcogl-common libcogl-pango20 linux-image-4.4.0-83-generic
 Suggested packages:
   fdutils linux-doc-4.4.0 | linux-source-4.4.0 linux-tools
 The following packages will be REMOVED
   linux-image-extra-4.8.0-53-generic
 The following NEW packages will be installed
   libcogl-common libcogl-pango20 linux-image-4.4.0-83-generic
 0 to upgrade, 3 to newly install, 1 to remove and 78 not to upgrade.
 9 not fully installed or removed.
 Need to get 0 B/58.0 MB of archives.
 After this operation, 94.3 MB disk space will be freed.
 Do you want to continue? [Y/n] y
 (Reading database ... 389562 files and directories currently installed.)
 Removing linux-image-extra-4.8.0-53-generic (4.8.0-53.56~16.04.1) ...
 run-parts: executing /etc/kernel/postinst.d/apt-auto-removal 4.8.0-53-generic /boot/vmlinuz-4.8.0-53-generic
 run-parts: executing /etc/kernel/postinst.d/dkms 4.8.0-53-generic /boot/vmlinuz-4.8.0-53-generic
 Error! Your kernel headers for kernel 4.8.0-53-generic cannot be found.
 Please install the linux-headers-4.8.0-53-generic package,
 or use the --kernelsourcedir option to tell DKMS where it's located
 run-parts: executing /etc/kernel/postinst.d/initramfs-tools 4.8.0-53-generic /boot/vmlinuz-4.8.0-53-generic
 update-initramfs: Generating /boot/initrd.img-4.8.0-53-generic
 cp: cannot stat '/etc/fonts/conf.d/60-latin.conf': No such file or directory
 E: /usr/share/initramfs-tools/hooks/plymouth failed with return 1.
 update-initramfs: failed for /boot/initrd.img-4.8.0-53-generic with 1.
 run-parts: /etc/kernel/postinst.d/initramfs-tools exited with return code 1
 dpkg: error processing package linux-image-extra-4.8.0-53-generic (--remove):
  subprocess installed post-removal script returned error exit status 1
 Errors were encountered while processing:
  linux-image-extra-4.8.0-53-generic
 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
 You might want to run ‘apt-get -f install’ to correct these.
 The following packages have unmet dependencies.
  libclutter-1.0-0 : Depends: libcogl-pango20 (>= 1.17.4) but it is not installed
                     Recommends: libclutter-1.0-common but it is not installed
  linux-image-extra-4.4.0-83-generic : Depends: linux-image-4.4.0-83-generic but it is not installed
 E: Unmet dependencies. Try using -f.

そして、そこが私です。それほど間違っていないようです-ほんの数個のカーネルパッケージが台無しになっていますが、それを解決しようとして苦労しています。このマシンには失われるデータベースがあり、現時点でバックアップするスペースがないため、再インストールする必要はありません。それらは重要ではありませんが、更新することができないという事実を除いて、それらを再構築するのに1、2日かかり、現時点ではマシンが実際に正常に動作しています。

次に何をしますか?

6
BobLong

実際にあなたと同じ問題に直面しました。そして、私はそれを修正するだけだと思います。 スクリーンショットはこちら

まず、 linux-headers-4.8.0-53_4.8.0-53.56〜16.04.1_all.deb をダウンロードしてインストールします。

次に、linux-headers-4.8.0-53-generic_4.8.0-53.56〜16.04.1_AMD64.debをダウンロードしてインストールします。

apt updateを試してからapt upgradeを試してください。

UPDATE

E: Sub-process /usr/bin/dpkg returned an error code (1)のようなエラーが見つかった場合は、次の手順に従ってください。

  1. dpkg --remove --force-remove-reinstreq linux-image-extra-4.8.0-58-genericを実行します
  2. 次にapt install linux-image-extra-4.8.0-58-genericを実行します
1
Muslim Aswaja