OS, Kernel version

OS: Linux Mint virginia 21.3 x86_64
Kernel: 5.15.0-119-generic

linux mint にてシステムアップデートをしようとした所、e2fsprogs というパッケージがアップデートに失敗していました。 いかのようなメッセージが出ました。

sudo apt upgrade
Reading package lists... Done
Building dependency tree... Done
Reading state information... Done
Calculating upgrade... Done
The following packages will be upgraded:
  comerr-dev e2fsprogs libcom-err2 libcom-err2:i386 libext2fs2 libss2 logsave
7 upgraded, 0 newly installed, 0 to remove and 0 not upgraded.
1 not fully installed or removed.
Need to get 0 B/881 kB of archives.
After this operation, 0 B of additional disk space will be used.
Do you want to continue? [Y/n] y
Setting up python3 (3.10.6-1~22.04.1) ...
running python rtupdate hooks for python3.10...
E: py3compile:272: Requested versions are not installed
error running python rtupdate hook xviewer-plugins
dpkg: error processing package python3 (--configure):
 installed python3 package post-installation script subprocess returned error exit status 4
Errors were encountered while processing:
 python3

やってみたこと

パッケージのプライオリティとインストレーションの確認

apt policy python3
  Installed: 3.10.6-1~22.04.1
  Candidate: 3.10.6-1~22.04.1
  Version table:
 *** 3.10.6-1~22.04.1 500 (phased 70%)
        500 http://ftp.riken.jp/Linux/ubuntu jammy-updates/main amd64 Packages
        100 /var/lib/dpkg/status
     3.10.6-1~22.04 500
        500 http://security.ubuntu.com/ubuntu jammy-security/main amd64 Packages
     3.10.4-0ubuntu2 500
        500 http://ftp.riken.jp/Linux/ubuntu jammy/main amd64 Packages

xviewer-plugins も確認

apt policy xviewer-plugins
  Installed: 3.4.0+victoria
  Candidate: 3.4.0+victoria
  Version table:
 *** 3.4.0+victoria 500
        500 http://ftp.jaist.ac.jp/pub/Linux/linuxmint/packages virginia/backport amd64 Packages
        100 /var/lib/dpkg/status

パッケージのインストールの修理

sudo dpkg --configure -a
Setting up python3 (3.10.6-1~22.04.1) ...
running python rtupdate hooks for python3.10...
E: py3compile:272: Requested versions are not installed
error running python rtupdate hook xviewer-plugins
dpkg: error processing package python3 (--configure):
 installed python3 package post-installation script subprocess returned error exit status 4
Errors were encountered while processing:
 python3

失敗しました。

hplip hplip-data をアンインストール

sudo apt-get remove --purge hplip hplip-data
Reading package lists... Done
Building dependency tree... Done
Reading state information... Done
The following packages will be REMOVED:
  hplip* hplip-data*
0 upgraded, 0 newly installed, 2 to remove and 7 not upgraded.
After this operation, 11.1 MB disk space will be freed.
Do you want to continue? [Y/n] y
(Reading database ... 871672 files and directories currently installed.)
Removing hplip (3.21.12+dfsg0-1) ...
Removing hplip-data (3.21.12+dfsg0-1) ...
dpkg: warning: while removing hplip-data, directory '/usr/share/hplip/ui5' not empty so not removed
dpkg: warning: while removing hplip-data, directory '/usr/share/hplip/scan' not empty so not removed
dpkg: warning: while removing hplip-data, directory '/usr/share/hplip/prnt' not empty so not removed
dpkg: warning: while removing hplip-data, directory '/usr/share/hplip/pcard' not empty so not removed
dpkg: warning: while removing hplip-data, directory '/usr/share/hplip/installer' not empty so not removed
dpkg: warning: while removing hplip-data, directory '/usr/share/hplip/fax' not empty so not removed
dpkg: warning: while removing hplip-data, directory '/usr/share/hplip/copier' not empty so not removed
dpkg: warning: while removing hplip-data, directory '/usr/share/hplip/base/pexpect' not empty so not removed
Processing triggers for dbus (1.12.20-2ubuntu4.1) ...
Processing triggers for man-db (2.10.2-1) ...
(Reading database ... 871049 files and directories currently installed.)
Purging configuration files for hplip (3.21.12+dfsg0-1) ...
Processing triggers for dbus (1.12.20-2ubuntu4.1) ...

インストールし直します。

sudo apt-get install hplip

成功しました。

Python Cache を取り除く

 sudo find /usr/share -name "__pycache__" -type d -exec rm -rf {} +

一応 python3 remove もためしましたが linux mint がいろいろなパッケージに依存しているためむりでした。

参照

https://www.linuxmintusers.de/index.php?topic=82579.0