I'm using Ubuntu 22.04.5 and apt got broken by Python 3.12 packages originally installed from deadsnakes/ppa. I tried sudo apt --fix-broken install, clean, autoclean and a few other tricks with no success. Here is what I have:
paul@desktop:~$ apt list python3.12*
Listing... Done
python3.12-dbg/jammy 3.12.10-1+jammy1 amd64
python3.12-dbg/jammy 3.12.10-1+jammy1 i386
python3.12-dev/jammy,now 3.12.10-1+jammy1 amd64 [installed]
python3.12-dev/jammy 3.12.10-1+jammy1 i386
python3.12-distutils/now 3.12.0~a1-1+jammy1 all [installed,local]
python3.12-examples/jammy,jammy 3.12.10-1+jammy1 all
python3.12-full/jammy 3.12.10-1+jammy1 amd64
python3.12-full/jammy 3.12.10-1+jammy1 i386
python3.12-gdbm-dbg/jammy 3.12.10-1+jammy1 amd64
python3.12-gdbm-dbg/jammy 3.12.10-1+jammy1 i386
python3.12-gdbm/jammy 3.12.10-1+jammy1 amd64
python3.12-gdbm/jammy 3.12.10-1+jammy1 i386
python3.12-lib2to3/jammy,jammy 3.12.10-1+jammy1 all [upgradable from: 3.12.8-1+jammy1]
python3.12-minimal/now 3.12.7-1+jammy1 amd64 [installed,local]
python3.12-tk-dbg/jammy 3.12.10-1+jammy1 amd64
python3.12-tk-dbg/jammy 3.12.10-1+jammy1 i386
python3.12-tk/jammy 3.12.10-1+jammy1 amd64 [upgradable from: 3.12.8-1+jammy1]
python3.12-tk/jammy 3.12.10-1+jammy1 i386
python3.12-venv/jammy,now 3.12.10-1+jammy1 amd64 [installed]
python3.12-venv/jammy 3.12.10-1+jammy1 i386
python3.12/jammy 3.12.10-1+jammy1 amd64 [upgradable from: 3.12.7-1+jammy1]
python3.12/jammy 3.12.10-1+jammy1 i386
This is an error I get each time I try to install something:
paul@desktop:~$ sudo apt install --reinstall python3.12-dev python3.12-venv python3.12-distutils python3.12-tk
Reading package lists... Done
Building dependency tree... Done
Reading state information... Done
Reinstallation of python3.12-distutils is not possible, it cannot be downloaded.
You might want to run 'apt --fix-broken install' to correct these.
The following packages have unmet dependencies:
libpython3.12 : Depends: libpython3.12-stdlib (= 3.12.10-1+jammy1) but 3.12.7-1+jammy1 is to be installed
libpython3.12-dev : Depends: libpython3.12-stdlib (= 3.12.10-1+jammy1) but 3.12.7-1+jammy1 is to be installed
python3.12-dev : Depends: python3.12 (= 3.12.10-1+jammy1) but 3.12.7-1+jammy1 is to be installed
python3.12-venv : Depends: python3.12 (= 3.12.10-1+jammy1) but 3.12.7-1+jammy1 is to be installed
E: Unmet dependencies. Try 'apt --fix-broken install' with no packages (or specify a solution).
How do I get out of this mess?