1

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?

4
  • You need to downgrade first. Run sudo apt install python3.10=3.10.12-1\~22.04.3 then sudo apt clean afterwards and sudo apt update and the policy entry won't exist anymore.
    – Thomas Ward
    Commented Jun 21 at 14:16
  • @ThomasWard My understanding is that the entry in the version table is "which version will be installed if apt needs to install this package". Is what you're saying that that's not the case here, and in this case what it means is "this is the version that's already installed, so if apt needs it it will not attempt to install it"?
    – Jack M
    Commented Jun 21 at 14:22
  • related askubuntu.com/q/1518305/124466 Commented Jun 21 at 14:46
  • @JackM /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, so apt 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 with apt 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!
    – Thomas Ward
    Commented Jun 21 at 15:00

0

You must log in to answer this question.

Browse other questions tagged .