apt アップグレードを実行した後に多くのエラーが発生するのはなぜですか?

apt アップグレードを実行した後に多くのエラーが発生するのはなぜですか?

今日、OS のアップグレードを実行しました。約 300 MB のファイルがダウンロードされました。アップグレード後、次のように表示されますsudo apt updatesudo apt upgrade

Errors were encountered while processing:
 nfs-common
 samba-common
 cups-daemon
 postgresql-10
 cups-core-drivers
 winbind
 libpam-winbind:amd64
 samba
 samba-common-bin
 linux-firmware
 libnss-winbind:amd64
 cups
 linux-image-generic
 linux-generic

おそらく依存関係の問題だと思うので、コマンドを実行しました sudo apt install -f。そして、さらにエラーが発生しました:

eading package lists... Done
Building dependency tree       
Reading state information... Done
The following packages were automatically installed and are no longer required:
  linux-image-4.4.0-146-generic linux-modules-4.4.0-146-generic
Use 'sudo apt autoremove' to remove them.
0 upgraded, 0 newly installed, 0 to remove and 0 not upgraded.
16 not fully installed or removed.
After this operation, 0 B of additional disk space will be used.
Setting up samba-common (2:4.7.6+dfsg~ubuntu-0ubuntu2.10) ...
dpkg: error processing package samba-common (--configure):
 installed samba-common package post-installation script subprocess returned error exit status 10
Setting up cups-daemon (2.2.7-1ubuntu2.5) ...
/var/lib/dpkg/info/cups-daemon.postinst: 150: /var/lib/dpkg/info/cups-daemon.postinst: update-rc.d: not found
dpkg: error processing package cups-daemon (--configure):
 installed cups-daemon package post-installation script subprocess returned error exit status 127
Setting up postgresql-10 (10.8-0ubuntu0.18.04.1) ...
/var/lib/dpkg/info/postgresql-10.postinst: 110: /var/lib/dpkg/info/postgresql-10.postinst: invoke-rc.d: not found
dpkg: error processing package postgresql-10 (--configure):
 installed postgresql-10 package post-installation script subprocess returned error exit status 127
dpkg: dependency problems prevent configuration of cups-core-drivers:
 cups-core-drivers depends on cups-daemon (>= 2.2.7-1ubuntu2.5); however:
  Package cups-daemon is not configured yet.

dpkg: error processing package cups-core-drivers (--configure):
 dependency problems - leaving unconfigured
dpkg: dependency problems prevent configuration of winbind:
 winbind depends on samba-common (= 2:4.7.6+dfsg~ubuntu-0ubuntu2.10); however:
  Package samba-common is not configured yet.

dpkg: error processing package winbind (--configure):
 dependency problems - leaving unconfigured
Setting up auditd (1:2.8.2-1ubuntu1) ...
No apport report written because MaxReports is reached already
                                                              No apport report written because MaxReports is reached already
                                                                                                                            /var/lib/dpkg/info/auditd.postinst: 62: /var/lib/dpkg/info/auditd.postinst: update-rc.d: not found
dpkg: error processing package auditd (--configure):
 installed auditd package post-installation script subprocess returned error exit status 127
dpkg: dependency problems prevent configuration of libpam-winbind:amd64:
 libpam-winbind:amd64 depends on samba-common (= 2:4.7.6+dfsg~ubuntu-0ubuntu2.10); however:
  Package samba-common is not configured yet.
 libpam-winbind:amd64 depends on winbind (= 2:4.7.6+dfsg~ubuntu-0ubuntu2.10); however:
  Package winbind is not configured yet.

dpkg: error processing package libpam-winbind:amd64 (--configure):
 dependency problems - leaving unconfigured
dpkg: dependency problems prevent configuration of samba:
 samba depends on samba-common (= 2:4.7.6+dfsg~ubuntu-0ubuntu2.10); however:
  Package samba-common is not configured yet.

dpkg: error processing package samba (--configure):
 dependency problems - leaving unconfigured
dpkg: dependency problems prevent configuration of samba-common-bin:
 samba-common-bNo apport report written because MaxReports is reached already
                                                                             No apport report written because MaxReports is reached already
                                                                                                                                           No apport report written because MaxReports is reached already
                                                                                                                                                                                                         No apport report written because MaxReports is reached already
                                                           in depends on samba-common (= 2:4.7.6+dfsg~ubuntu-0ubuntu2.10); however:
  Package samba-common is not configured yet.

dpkg: error processing package samba-common-bin (--configure):
 dependency problems - leaving unconfigured
Setting up linux-firmware (1.173.6) ...
update-initramfs: Generating /boot/initrd.img-4.15.0-48-generic
/usr/sbin/update-initramfs: 157: /usr/sbin/update-initramfs: mkinitramfs: not found
update-initramfs: failed for /boot/initrd.img-4.15.0-48-generic with 127.
dpkg: error processing package linux-firmware (--configure):
 installed linux-firmware package post-installation script subprocess returned error exit status 127
No apport report written because MaxReports is reached already
                                                              Setting up rpcbind (0.2.3-0.6) ...
/var/lib/dpkg/info/rpcbind.postinst: 92: /var/lib/dpkg/info/rpcbind.postinst: update-rc.d: not found
dpkg: error processing package rpcbind (--configure):
 installed rpcbind package post-installation script subprocess returned error exit status 127
No apport report written because MaxReports is reached already
                                                              dpkg: dependency problems prevent configuration of libnss-winbind:amd64:
 libnss-winbind:amd64 depends on samba-common (= 2:4.7.6+dfsg~ubuntu-0ubuntu2.10); however:
  Package samba-common is not configured yet.
 libnss-winbind:amd64 depends on winbind (= 2:4.7.6+dfsg~ubuntu-0ubuntu2.10); however:
  Package winbind is not configured yet.

dpkg: error processing package libnss-winbind:amd64 (--configure):
 dependency problems - leaving unconfigured
No apport report written because MaxReports is reached already
                                                              dpkg: dependency problems prevent configuration of nfs-common:
 nfs-common depends on rpcbind; however:
  Package rpcbind is not configured yet.

dpkg: error processing package nfs-common (--configure):
 dependency problems - leaving unconfigured
No apport report written because MaxReports is reached already
                                                              dpkg: dependency problems prevent configuration of cups:
 cups depends on cups-core-drivers (>= 2.2.7-1ubuntu2.5); however:
  Package cups-core-drivers is not configured yet.
 cups depends on cups-daemon (>= 2.2.7-1ubuntu2.5); however:
  Package cups-daemon is not configured yet.

dpkg: error processing package cups (--configure):
 dependency problems - leaving unconfigured
No apport report written because MaxReports is reached already
                                                              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
No apport report written because MaxReports is reached already
                                                              dpkg: dependency problems prevent configuration of linux-generic:
 linux-generic depends on linux-image-generic (= 4.15.0.50.52); 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 MaxReports is reached already
                                                              Errors were encountered while processing:
 samba-common
 cups-daemon
 postgresql-10
 cups-core-drivers
 winbind
 auditd
 libpam-winbind:amd64
 samba
 samba-common-bin
 linux-firmware
 rpcbind
 libnss-winbind:amd64
 nfs-common
 cups
 linux-image-generic
 linux-generic
E: Sub-process /usr/bin/dpkg returned an error code (1)

私のOSバージョンは次のとおりです:

Linux MyUbuntu105 4.15.0-48-generic #51-Ubuntu SMP Wed Apr 3 08:28:49 UTC 2019 x86_64 x86_64 x86_64 GNU/Linux

OS を 16.04 から 18.04 にアップグレードしたばかりですが、この問題が発生する可能性はありますか? どうすれば修正できますか? ありがとうございます!

答え1

上記のエラーは、、およびが欠落していることを示していますupdate-rc.dinvoke-rc.dmkinitramfs

インストールするには

sudo apt-get install init-system-helpers initramfs-tools-core

(パッケージファイルリストを参照 -init-system-helpersそしてinitramfs-tools-core


失敗した場合は、次のコマンドでこのパッケージを手動でインストールしますdpkg

cd ~/Downloads
apt-get download init-system-helpers initramfs-tools-core
sudo dpkg -i --force-all init-system-helpers*.deb
sudo dpkg -i --force-all initramfs-tools-core*.deb

最後に通常の方法でこれを再インストールします:

sudo apt-get install --reinstall init-system-helpers initramfs-tools-core

その後、必要なパッケージのインストールを再試行してください。

関連情報