apt はもはやトリガーを処理しません。

apt はもはやトリガーを処理しません。

今朝は小さなアップデートをインストールしましたが、今aptはトリガ処理を中止しました。突然、このような問題がなぜ発生するのかわかりません。

$ sudo apt upgrade --autoremove
Reading package lists... Done
Building dependency tree... Done
Reading state information... Done
Calculating upgrade... Done
The following packages will be REMOVED:
  linux-image-5.10.0-10-amd64
The following packages will be upgraded:
  libexpat1
1 upgraded, 0 newly installed, 1 to remove and 0 not upgraded.
Need to get 0 B/98.5 kB of archives.
After this operation, 302 MB disk space will be freed.
Do you want to continue? [Y/n] y
Reading changelogs... Done
(Reading database ... 152993 files and directories currently installed.)
Removing linux-image-5.10.0-10-amd64 (5.10.84-1) ...
/etc/kernel/postrm.d/initramfs-tools:
update-initramfs: Deleting /boot/initrd.img-5.10.0-10-amd64
/etc/kernel/postrm.d/zz-update-grub:
Generating grub configuration file ...
Found background image: /usr/share/images/desktop-base/desktop-grub.png
Found linux image: /boot/vmlinuz-5.10.0-12-amd64
Found initrd image: /boot/initrd.img-5.10.0-12-amd64
Found linux image: /boot/vmlinuz-5.10.0-11-amd64
Found initrd image: /boot/initrd.img-5.10.0-11-amd64
done
(Reading database ... 148225 files and directories currently installed.)
Preparing to unpack .../libexpat1_2.2.10-2+deb11u3_amd64.deb ...
Unpacking libexpat1:amd64 (2.2.10-2+deb11u3) over (2.2.10-2+deb11u2) ...
Setting up libexpat1:amd64 (2.2.10-2+deb11u3) ...
Processing triggers for libc-bin (2.31-13+deb11u2) ...
^C

タイムアウトは発生せず、再インストールしようとしたときに同じ問題が発生しました。

$ sudo apt install libexpat1 --reinstall
Reading package lists... Done
Building dependency tree... Done
Reading state information... Done
0 upgraded, 0 newly installed, 1 reinstalled, 0 to remove and 0 not upgraded.
Need to get 0 B/98.5 kB of archives.
After this operation, 0 B of additional disk space will be used.
(Reading database ... 148225 files and directories currently installed.)
Preparing to unpack .../libexpat1_2.2.10-2+deb11u3_amd64.deb ...
Unpacking libexpat1:amd64 (2.2.10-2+deb11u3) over (2.2.10-2+deb11u3) ...
Setting up libexpat1:amd64 (2.2.10-2+deb11u3) ...
Processing triggers for libc-bin (2.31-13+deb11u2) ...
^C

カールのような小さなパッケージが同じ方法で再び中断されても、それを削除してインストールすることができます。

$ sudo apt remove curl
Reading package lists... Done
Building dependency tree... Done
Reading state information... Done
The following packages will be REMOVED:
  curl
0 upgraded, 0 newly installed, 1 to remove and 0 not upgraded.
After this operation, 436 kB disk space will be freed.
Do you want to continue? [Y/n] y
(Reading database ... 148225 files and directories currently installed.)
Removing curl (7.74.0-1.3+deb11u1) ...
Processing triggers for man-db (2.9.4-2) ...

$ sudo apt install curl
Reading package lists... Done
Building dependency tree... Done
Reading state information... Done
The following NEW packages will be installed:
  curl
0 upgraded, 1 newly installed, 0 to remove and 0 not upgraded.
Need to get 0 B/267 kB of archives.
After this operation, 436 kB of additional disk space will be used.
Selecting previously unselected package curl.
(Reading database ... 148217 files and directories currently installed.)
Preparing to unpack .../curl_7.74.0-1.3+deb11u1_amd64.deb ...
Unpacking curl (7.74.0-1.3+deb11u1) ...
Setting up curl (7.74.0-1.3+deb11u1) ...
Processing triggers for man-db (2.9.4-2) ...
^C

$ curl --version
curl 7.74.0 (x86_64-pc-linux-gnu) libcurl/7.74.0 OpenSSL/1.1.1k zlib/1.2.11 brotli/1.0.9 libidn2/2.3.0 libpsl/0.21.0 (+libidn2/2.3.0) libssh2/1.9.0 nghttp2/1.43.0 librtmp/2.3
Release-Date: 2020-12-09
Protocols: dict file ftp ftps gopher http https imap imaps ldap ldaps mqtt pop3 pop3s rtmp rtsp scp sftp smb smbs smtp smtps telnet tftp 
Features: alt-svc AsynchDNS brotli GSS-API HTTP2 HTTPS-proxy IDN IPv6 Kerberos Largefile libz NTLM NTLM_WB PSL SPNEGO SSL TLS-SRP UnixSockets

以下は、システムに関するいくつかの一般的な情報です。

$ cat /etc/debian_version 
11.2

$ apt --version
apt 2.2.4 (amd64)

$ uname -a
Linux <system> 5.10.0-12-amd64 #1 SMP Debian 5.10.103-1 (2022-03-07) x86_64 GNU/Linux

次回確認すべき事項の提案がありますか?

ベストアンサー1

pstreeそのプロセスの子プロセスを使用して確認し、中断された再起動が必要なaptプロセスを見つけることができました。

        |-systemd-+-(sd-pam)
        |         |-apt---sh---needrestart

ただし、needrestartが原因でシステムが激しく停止し、psなどの一般的なコマンドを実行してPIDを取得してシャットダウンすることはできません。大きなハンマーで問題を解決し、マシン全体を再起動しました。

再起動後、すべてのコマンドが期待どおりに機能し、インストールにエラーがないようです。 libexpat1 も --audit コマンドによって部分的にインストールされたパッケージとしてリストされません。

$ sudo dpkg --audit

おすすめ記事