Debian 9 でアップグレードを実行中にエラーが発生しました。

Debian 9 でアップグレードを実行中にエラーが発生しました。

ルートとしてログインしてもアップグレードを実行しようとしたときに発生する競合は次のとおりです。

root@:/home/frederic# apt-get upgrade
Reading package lists... Done
Building dependency tree       
Reading state information... Done
Calculating upgrade... Done
0 upgraded, 0 newly installed, 0 to remove and 0 not upgraded.
3 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 linux-headers-4.9.0-3-amd64 (4.9.30-2+deb9u3) ...
/etc/kernel/header_postinst.d/dkms:
Error! You must be root to use this command.
run-parts: /etc/kernel/header_postinst.d/dkms exited with return code 1
Failed to process /etc/kernel/header_postinst.d at /var/lib/dpkg/info/linux-headers-4.9.0-3-amd64.postinst line 11.
dpkg: error processing package linux-headers-4.9.0-3-amd64 (--configure):
 subprocess installed post-installation script returned error exit status 1
Setting up linux-image-4.9.0-3-amd64 (4.9.30-2+deb9u3) ...
/etc/kernel/postinst.d/dkms:
Error! You must be root to use this command.
run-parts: /etc/kernel/postinst.d/dkms exited with return code 1
dpkg: error processing package linux-image-4.9.0-3-amd64 (--configure):
 subprocess installed post-installation script returned error exit status 1
dpkg: dependency problems prevent configuration of linux-image-amd64:
 linux-image-amd64 depends on linux-image-4.9.0-3-amd64; however:
  Package linux-image-4.9.0-3-amd64 is not configured yet.

dpkg: error processing package linux-image-amd64 (--configure):
 dependency problems - leaving unconfigured
Errors were encountered while processing:
 linux-headers-4.9.0-3-amd64
 linux-image-4.9.0-3-amd64
 linux-image-amd64
E: Sub-process /usr/bin/dpkg returned an error code (1)

私が見るには問題があるようですdkmsパッケージを再インストールしようとしても問題ありません。

root@:/home/frederic# apt-get install --reinstall dkms
Reading package lists... Done
Building dependency tree       
Reading state information... Done
0 upgraded, 0 newly installed, 1 reinstalled, 0 to remove and 0 not upgraded.
3 not fully installed or removed.
Need to get 0 B/74.8 kB of archives.
After this operation, 0 B of additional disk space will be used.
(Reading database ... 142800 files and directories currently installed.)
Preparing to unpack .../archives/dkms_2.3-2_all.deb ...
Unpacking dkms (2.3-2) over (2.3-2) ...
Setting up linux-headers-4.9.0-3-amd64 (4.9.30-2+deb9u3) ...
/etc/kernel/header_postinst.d/dkms:
Error! You must be root to use this command.
run-parts: /etc/kernel/header_postinst.d/dkms exited with return code 1
Failed to process /etc/kernel/header_postinst.d at /var/lib/dpkg/info/linux-headers-4.9.0-3-amd64.postinst line 11.
dpkg: error processing package linux-headers-4.9.0-3-amd64 (--configure):
 subprocess installed post-installation script returned error exit status 1
Setting up dkms (2.3-2) ...
Processing triggers for man-db (2.7.6.1-2) ...
Setting up linux-image-4.9.0-3-amd64 (4.9.30-2+deb9u3) ...
/etc/kernel/postinst.d/dkms:
Error! You must be root to use this command.
run-parts: /etc/kernel/postinst.d/dkms exited with return code 1
dpkg: error processing package linux-image-4.9.0-3-amd64 (--configure):
 subprocess installed post-installation script returned error exit status 1
dpkg: dependency problems prevent configuration of linux-image-amd64:
 linux-image-amd64 depends on linux-image-4.9.0-3-amd64; however:
  Package linux-image-4.9.0-3-amd64 is not configured yet.

dpkg: error processing package linux-image-amd64 (--configure):
 dependency problems - leaving unconfigured
Errors were encountered while processing:
 linux-headers-4.9.0-3-amd64
 linux-image-4.9.0-3-amd64
 linux-image-amd64
E: Sub-process /usr/bin/dpkg returned an error code (1)

ベストアンサー1

エラーが発生した場合のdkms最初のアクションは、dkmsエラーの主な原因を調査するために時間を無駄にする前に実際に必要であることを確認することです。

通常dkms、新しいカーネルバージョンでパッケージをインストールした後、デフォルトのカーネルの一部ではない追加のモジュールを自動的に(再)コンパイル/インストールするために使用されます。たとえば、sysdigモジュールまたはRealtekドライバ、以前のDebianバージョンでは、VMware vmtoolsモジュールがあります。

リクエストが示すように、 ls -la /var/lib/dkms(通常はソースコードを持つ(サブ)ディレクトリ)コンパイルする追加のモジュールはありません。

したがって、私たちはdkmsがこのシステムで役に立つ仕事をしていないことを知っています。

ls -la /var/lib/dkms
total 12 
drwxr-xr-x 2  root root 4096 Sep  1 11:53 . 
drwxr-xr-x 46 root root 4096 Aug 30 16:18 .. 
-rw-r--r-- 1  root root    6 Aug 31 2016 dkms_dbversion

したがって、推奨されるアクションは、次のコマンドを使用して削除することです。

sudo aptitude purge dkms

おすすめ記事