I'm having trouble installing a package, and I think it might be because apt wants to install the wrong version of it.
If I run apt-cache policy python3.10
, I see:
$ sudo apt-cache policy python3.10
python3.10:
Installed: 3.10.14-1+focal1
Candidate: 3.10.14-1+focal1
Version table:
*** 3.10.14-1+focal1 100
100 /var/lib/dpkg/status
3.10.12-1~22.04.3 500
500 http://ubuntu-arch.linux.edu.lv/ubuntu jammy-updates/main amd64 Packages
500 http://ubuntu-arch.linux.edu.lv/ubuntu jammy-security/main amd64 Packages
3.10.4-3 500
500 http://ubuntu-arch.linux.edu.lv/ubuntu jammy/main amd64 Packages
I have just upgraded from focal to jammy, and I think the first line in the version table is causing problems - apt wants to install the focal version instead of the jammy version.
How can I drop that version so it doesn't appear in this list, and so apt doesn't use that one anymore?
sudo apt install python3.10=3.10.12-1\~22.04.3
thensudo apt clean
afterwards andsudo apt update
and the policy entry won't exist anymore./var/lib/dpkg/status
indicates this was installed previously, and because it was previously installed it's a higher priority. Additionally, the version string is higher, soapt
won't install "Older" versions on top of 'newer' unless you tell it to. Once you downgrade the 'older' version becomes what's installed, and once you clear your apt cache withapt clean
it'll no longer realize there was a newer version ever available. Note this can break things in general so be careful when messing with system python versions!