失敗した場合のパッケージの強制削除

失敗した場合のパッケージの強制削除

私のシステムにはいくつかの破損した依存関係がありますが、経由で削除しようとするとapt-get purgeプロセスdpkg --purge --force-allが失敗しますerrors were encountered while processing

具体的には、依存関係を削除できなくなったlinux-image-extraパッケージがあります。linux-image最新のカーネルがインストールされているため、アンインストールは問題になりませんが、アンインストールプロセスは失敗し続けます。

それでは、クラッシュが発生しないようにパッケージを強制的に削除してシステムを再更新できますか?


削除中のエラー:

sudo dpkg --purge --force-all linux-image-extra-3.19.0-51-generic
(Reading database ... 229019 files and directories currently installed.)
Removing linux-image-extra-3.19.0-51-generic (3.19.0-51.58) ...
depmod: FATAL: could not load /boot/System.map-3.19.0-51-generic: No such file or directory
run-parts: executing /etc/kernel/postinst.d/apt-auto-removal 3.19.0-51-generic /boot/vmlinuz-3.19.0-51-generic
run-parts: executing /etc/kernel/postinst.d/initramfs-tools 3.19.0-51-generic /boot/vmlinuz-3.19.0-51-generic
update-initramfs: Generating /boot/initrd.img-3.19.0-51-generic
WARNING: missing /lib/modules/3.19.0-51-generic
Ensure all necessary drivers are built into the linux image!
depmod: ERROR: could not open directory /lib/modules/3.19.0-51-generic: No such file or directory
depmod: FATAL: could not search modules: No such file or directory
sed: can't read /usr/share/plymouth/themes/kubuntu-text/kubuntu-text.plymouth: No such file or directory
E: /usr/share/initramfs-tools/hooks/plymouth failed with return 2.
update-initramfs: failed for /boot/initrd.img-3.19.0-51-generic with 2.
run-parts: /etc/kernel/postinst.d/initramfs-tools exited with return code 2
dpkg: error processing package linux-image-extra-3.19.0-51-generic (--purge):
 subprocess installed post-removal script returned error exit status 1
Errors were encountered while processing:
 linux-image-extra-3.19.0-51-generic

ベストアンサー1

いいえ一般的な手順ですが、特定の状況の具体的な分析が必要です。このページに見られるように尊敬される常に有効なアプローチではありません。

推奨手順を試した場合は、既にトラブルシューティング手順に入っています。

時にはダミーファイルやディレクトリを追加して、削除スクリプトを実行することができます。この場合、次のことができます。

depmod: ERROR: could not open directory /lib/modules/3.19.0-51-generic: No such file or directory

ただし、この場合、

depmod: FATAL: could not load /boot/System.map-3.19.0-51-generic: No such file or directory

与えられたファイルになるので解決が難しいです。滞在。 (長さ0のファイルを作成してみることもできますが、おそらく動作しません。)

または、破損したパッケージを再インストールする場合は、アンインストーラが処理できる順序で欠落している部分を復元して動作することがあります。

おすすめ記事