This isn’t strictly speaking a Python issue, but it involves upgrade of Python on a Debian-like system (whatever Oracle calls their Linux). I use 3.10 on my website, and Oracle told me there were some updates to perform, so I executed:
apt update
apt upgrade
That worked except for two packages which seem stuck:
% apt upgrade
Reading package lists… Done
Building dependency tree
Reading state information… Done
You might want to run ‘apt --fix-broken install’ to correct these.
The following packages have unmet dependencies:
python3.10 : Depends: libpython3.10-stdlib (= 3.10.4-1+focal2) but 3.10.3-1+focal1 is installed
python3.10-minimal : Depends: libpython3.10-minimal (= 3.10.4-1+focal2) but 3.10.3-1+focal1 is installed
E: Unmet dependencies. Try ‘apt --fix-broken install’ with no packages (or specify a solution).
I tried the suggested fix but that didn’t help:
% apt --fix-broken install
Reading package lists… Done
Building dependency tree
… …
Unpacking libpython3.10-stdlib:amd64 (3.10.4-1+focal2) over (3.10.3-1+focal1) …
… …
Unpacking libpython3.10-minimal:amd64 (3.10.4-1+focal2) over (3.10.3-1+focal1) …
dpkg: error processing archive /var/cache/apt/archives/libpython3.10-minimal_3.10.4-1+focal2_amd64.deb (–unpack):
trying to overwrite ‘/usr/lib/python3.10/typing.py’, which is also in package libpython3.10-stdlib:amd64 3.10.3-1+focal1
dpkg-deb: error: paste subprocess was killed by signal (Broken pipe)
Errors were encountered while processing:
/var/cache/apt/archives/libpython3.10-stdlib_3.10.4-1+focal2_amd64.deb
/var/cache/apt/archives/libpython3.10-minimal_3.10.4-1+focal2_amd64.deb
E: Sub-process /usr/bin/dpkg returned an error code (1)
It would appear that I am actually at 3.10.4:
% apt list | egrep ‘python3.10.*3.10.4’
WARNING: apt does not have a stable CLI interface. Use with caution in scripts.
idle-python3.10/focal 3.10.4-1+focal2 all
libpython3.10-dbg/focal 3.10.4-1+focal2 amd64
libpython3.10-dev/focal 3.10.4-1+focal2 amd64
libpython3.10-minimal/focal 3.10.4-1+focal2 amd64 [upgradable from: 3.10.3-1+focal1]
libpython3.10-stdlib/focal 3.10.4-1+focal2 amd64 [upgradable from: 3.10.3-1+focal1]
libpython3.10-testsuite/focal 3.10.4-1+focal2 all
libpython3.10/focal 3.10.4-1+focal2 amd64
libqgispython3.10.4/focal 3.10.4+dfsg-1ubuntu2 amd64
python3.10-dbg/focal 3.10.4-1+focal2 amd64
python3.10-dev/focal 3.10.4-1+focal2 amd64
python3.10-distutils/focal,now 3.10.4-1+focal2 all [installed,automatic]
python3.10-examples/focal 3.10.4-1+focal2 all
python3.10-full/focal 3.10.4-1+focal2 amd64
python3.10-gdbm-dbg/focal 3.10.4-1+focal2 amd64
python3.10-gdbm/focal 3.10.4-1+focal2 amd64
python3.10-lib2to3/focal,now 3.10.4-1+focal2 all [installed,automatic]
python3.10-minimal/focal,now 3.10.4-1+focal2 amd64 [installed,automatic]
python3.10-tk-dbg/focal 3.10.4-1+focal2 amd64
python3.10-tk/focal 3.10.4-1+focal2 amd64
python3.10-venv/focal,now 3.10.4-1+focal2 amd64 [installed]
python3.10/focal,now 3.10.4-1+focal2 amd64 [installed]
% python3.10
Python 3.10.4 (main, Apr 8 2022, 17:35:13) [GCC 9.4.0] on linux
Type “help”, “copyright”, “credits” or “license” for more information.
but there is some record wrong in some dpkg
database.
% apt list -a libpython3.10-minimal
Listing… Done
libpython3.10-minimal/focal 3.10.4-1+focal2 amd64 [upgradable from: 3.10.3-1+focal1]
libpython3.10-minimal/now 3.10.3-1+focal1 amd64 [installed,upgradable to: 3.10.4-1+focal2]% apt list -a python3.10
Listing… Done
python3.10/focal,now 3.10.4-1+focal2 amd64 [installed]
I am unclear how to proceed from here. Any suggestions for how to fix this (or where a better place to ask this not-really-python question)?