I’ve got an interesting question, which concerns APT pinning. Ever since Ubuntu’s inception and the split between the Main and Universe components, I’ve tried to make sure to at least try to install from Main first. So I came up with this idea, to try this with APT pins. Then I read that the new solver would also aim to converge an upgraded system with a freshly installed one.
Maybe @juliank can chime in to shed some light on this idea, which I think could make the Ubuntu experience more consistent, because users are steered towards Main packages first, when it comes to installing dependencies. I’ll share my *.prefs further down, to illustrate what I have in mind, but since those regular expressions aren’t exactly readable for everyone, I think some higher level explanation is in order, so bare with me, please.
This is mostly about which packages get installed when a user requests to install a package A, which OR-depends on multiple packages, e.g. 'Depends/Recommends/Suggests: B | C'. It’s hard to find packages to test this with, BTW, so I can only try and guess what the solver would do. I think to remember, and I may be wrong, that the old solver will simply choose B because it’s the first match in the list, and only after that will it look at which exact version to install, which is where APT preferences (pins) come into play. So that would not help in selecting from Main by priority, since the priority is already encoded in the control file.
But can the new solver take pins into account when deciding which package to install, by setting generic pins for Main/Restricted/UbuntuESM… to, say, 990, the priority of the APT::Default-Release, which is unset in Ubuntu, BTW, so all packages have priority 500. I did try to do this the other way around, by setting the default release to Noble and then trying to reduce the pin priority, but I ran into limitations with general priorities vs. specific pin-priorites. What the following *.pref are aiming to do, is, to emulate APT::Default-Release but only for the officially supported Main/Restricted repos and, if enabled, the Ubuntu Pro ones too:
Explanation: Do not install multiverse packages automatically
Package: *
Pin: release c=multiverse
Pin-Priority: 100
# This is redundant as long as below pref record excludes backports, i.e. the 'a=...' regex.
#Package: *
#Pin: release a=*-backports
#Pin-Priority: 100
Explanation: Prefer officially supported packages by emulating APT::Default-Release
Explanation: but only for the actual "premium" packages.
Package: *
Pin: release o=/^Ubuntu(ESM(Apps)?)?$/, c=/^(main|restricted)$/, a=/^[[:alpha:]]+((-(apps|infra)?)?-(security|updates))?$/
Pin-Priority: 990
It got a little complicated, once I realized that my regex was too greedy.
So I left that commented out block in there, to hint myself. But I hope the gist is somewhat clear. There’s also this quirk with ESM(Apps), which make packages that were formerly in Universe into Main packages. I’d really rather not see them “promoted” that way, because what happens in the next LTS? Will they stay in Main, like a field promotion being finalized, or will they start out in Universe again, because that might get interesting. There’s also the issue, that those packages are only in Main, because of some security snafu, but now they appear like my preferred ones.
I think this could be most interesting, especially in do-release-upgrade scenarios. Newer package versions might suggest new or different packages, which is not only interesting for the OR (|) dependencies but also for virtual packages, which only “exits”, because (an)other package(s) Provides: them. If multiple packages provide some functionality, I’d really like to get the best matching package from Main, and only if there isn’t one, from Universe.
I really hope that this is actually how this could work with the new solver, because that aim, to stay as close as possible to what a fresh installation would get me, has always been a wish list bug I never filed, so thanks for reading my mind.
BTW, that’s my live 99-ubuntu.pref, There’s only one more irrelevant one for the Tor repository. And this is what apt-cache policy has to say to that:
Package files:
100 /var/lib/dpkg/status
release a=now
100 http://security.ubuntu.com/ubuntu noble-security/multiverse i386 Packages
release v=24.04,o=Ubuntu,a=noble-security,n=noble,l=Ubuntu,c=multiverse,b=i386
origin security.ubuntu.com
100 http://security.ubuntu.com/ubuntu noble-security/multiverse amd64 Packages
release v=24.04,o=Ubuntu,a=noble-security,n=noble,l=Ubuntu,c=multiverse,b=amd64
origin security.ubuntu.com
500 http://security.ubuntu.com/ubuntu noble-security/universe i386 Packages
release v=24.04,o=Ubuntu,a=noble-security,n=noble,l=Ubuntu,c=universe,b=i386
origin security.ubuntu.com
500 http://security.ubuntu.com/ubuntu noble-security/universe amd64 Packages
release v=24.04,o=Ubuntu,a=noble-security,n=noble,l=Ubuntu,c=universe,b=amd64
origin security.ubuntu.com
990 http://security.ubuntu.com/ubuntu noble-security/restricted i386 Packages
release v=24.04,o=Ubuntu,a=noble-security,n=noble,l=Ubuntu,c=restricted,b=i386
origin security.ubuntu.com
990 http://security.ubuntu.com/ubuntu noble-security/restricted amd64 Packages
release v=24.04,o=Ubuntu,a=noble-security,n=noble,l=Ubuntu,c=restricted,b=amd64
origin security.ubuntu.com
990 http://security.ubuntu.com/ubuntu noble-security/main i386 Packages
release v=24.04,o=Ubuntu,a=noble-security,n=noble,l=Ubuntu,c=main,b=i386
origin security.ubuntu.com
990 http://security.ubuntu.com/ubuntu noble-security/main amd64 Packages
release v=24.04,o=Ubuntu,a=noble-security,n=noble,l=Ubuntu,c=main,b=amd64
origin security.ubuntu.com
100 http://de.archive.ubuntu.com/ubuntu noble-backports/multiverse i386 Packages
release v=24.04,o=Ubuntu,a=noble-backports,n=noble,l=Ubuntu,c=multiverse,b=i386
origin de.archive.ubuntu.com
100 http://de.archive.ubuntu.com/ubuntu noble-backports/multiverse amd64 Packages
release v=24.04,o=Ubuntu,a=noble-backports,n=noble,l=Ubuntu,c=multiverse,b=amd64
origin de.archive.ubuntu.com
100 http://de.archive.ubuntu.com/ubuntu noble-backports/universe i386 Packages
release v=24.04,o=Ubuntu,a=noble-backports,n=noble,l=Ubuntu,c=universe,b=i386
origin de.archive.ubuntu.com
100 http://de.archive.ubuntu.com/ubuntu noble-backports/universe amd64 Packages
release v=24.04,o=Ubuntu,a=noble-backports,n=noble,l=Ubuntu,c=universe,b=amd64
origin de.archive.ubuntu.com
100 http://de.archive.ubuntu.com/ubuntu noble-backports/main i386 Packages
release v=24.04,o=Ubuntu,a=noble-backports,n=noble,l=Ubuntu,c=main,b=i386
origin de.archive.ubuntu.com
100 http://de.archive.ubuntu.com/ubuntu noble-backports/main amd64 Packages
release v=24.04,o=Ubuntu,a=noble-backports,n=noble,l=Ubuntu,c=main,b=amd64
origin de.archive.ubuntu.com
100 http://de.archive.ubuntu.com/ubuntu noble-updates/multiverse i386 Packages
release v=24.04,o=Ubuntu,a=noble-updates,n=noble,l=Ubuntu,c=multiverse,b=i386
origin de.archive.ubuntu.com
100 http://de.archive.ubuntu.com/ubuntu noble-updates/multiverse amd64 Packages
release v=24.04,o=Ubuntu,a=noble-updates,n=noble,l=Ubuntu,c=multiverse,b=amd64
origin de.archive.ubuntu.com
500 http://de.archive.ubuntu.com/ubuntu noble-updates/universe i386 Packages
release v=24.04,o=Ubuntu,a=noble-updates,n=noble,l=Ubuntu,c=universe,b=i386
origin de.archive.ubuntu.com
500 http://de.archive.ubuntu.com/ubuntu noble-updates/universe amd64 Packages
release v=24.04,o=Ubuntu,a=noble-updates,n=noble,l=Ubuntu,c=universe,b=amd64
origin de.archive.ubuntu.com
990 http://de.archive.ubuntu.com/ubuntu noble-updates/restricted i386 Packages
release v=24.04,o=Ubuntu,a=noble-updates,n=noble,l=Ubuntu,c=restricted,b=i386
origin de.archive.ubuntu.com
990 http://de.archive.ubuntu.com/ubuntu noble-updates/restricted amd64 Packages
release v=24.04,o=Ubuntu,a=noble-updates,n=noble,l=Ubuntu,c=restricted,b=amd64
origin de.archive.ubuntu.com
990 http://de.archive.ubuntu.com/ubuntu noble-updates/main i386 Packages
release v=24.04,o=Ubuntu,a=noble-updates,n=noble,l=Ubuntu,c=main,b=i386
origin de.archive.ubuntu.com
990 http://de.archive.ubuntu.com/ubuntu noble-updates/main amd64 Packages
release v=24.04,o=Ubuntu,a=noble-updates,n=noble,l=Ubuntu,c=main,b=amd64
origin de.archive.ubuntu.com
100 http://de.archive.ubuntu.com/ubuntu noble/multiverse i386 Packages
release v=24.04,o=Ubuntu,a=noble,n=noble,l=Ubuntu,c=multiverse,b=i386
origin de.archive.ubuntu.com
100 http://de.archive.ubuntu.com/ubuntu noble/multiverse amd64 Packages
release v=24.04,o=Ubuntu,a=noble,n=noble,l=Ubuntu,c=multiverse,b=amd64
origin de.archive.ubuntu.com
500 http://de.archive.ubuntu.com/ubuntu noble/universe i386 Packages
release v=24.04,o=Ubuntu,a=noble,n=noble,l=Ubuntu,c=universe,b=i386
origin de.archive.ubuntu.com
500 http://de.archive.ubuntu.com/ubuntu noble/universe amd64 Packages
release v=24.04,o=Ubuntu,a=noble,n=noble,l=Ubuntu,c=universe,b=amd64
origin de.archive.ubuntu.com
990 http://de.archive.ubuntu.com/ubuntu noble/restricted i386 Packages
release v=24.04,o=Ubuntu,a=noble,n=noble,l=Ubuntu,c=restricted,b=i386
origin de.archive.ubuntu.com
990 http://de.archive.ubuntu.com/ubuntu noble/restricted amd64 Packages
release v=24.04,o=Ubuntu,a=noble,n=noble,l=Ubuntu,c=restricted,b=amd64
origin de.archive.ubuntu.com
990 http://de.archive.ubuntu.com/ubuntu noble/main i386 Packages
release v=24.04,o=Ubuntu,a=noble,n=noble,l=Ubuntu,c=main,b=i386
origin de.archive.ubuntu.com
990 http://de.archive.ubuntu.com/ubuntu noble/main amd64 Packages
release v=24.04,o=Ubuntu,a=noble,n=noble,l=Ubuntu,c=main,b=amd64
origin de.archive.ubuntu.com
990 https://esm.ubuntu.com/infra/ubuntu noble-infra-security/main amd64 Packages
release v=24.04,o=UbuntuESM,a=noble-infra-security,n=noble,l=UbuntuESM,c=main,b=amd64
origin esm.ubuntu.com
990 https://esm.ubuntu.com/infra/ubuntu noble-infra-updates/main amd64 Packages
release v=24.04,o=UbuntuESM,a=noble-infra-updates,n=noble,l=UbuntuESM,c=main,b=amd64
origin esm.ubuntu.com
990 https://esm.ubuntu.com/apps/ubuntu noble-apps-updates/main amd64 Packages
release v=24.04,o=UbuntuESMApps,a=noble-apps-updates,n=noble,l=UbuntuESMApps,c=main,b=amd64
origin esm.ubuntu.com
990 https://esm.ubuntu.com/apps/ubuntu noble-apps-security/main i386 Packages
release v=24.04,o=UbuntuESMApps,a=noble-apps-security,n=noble,l=UbuntuESMApps,c=main,b=i386
origin esm.ubuntu.com
990 https://esm.ubuntu.com/apps/ubuntu noble-apps-security/main amd64 Packages
release v=24.04,o=UbuntuESMApps,a=noble-apps-security,n=noble,l=UbuntuESMApps,c=main,b=amd64
origin esm.ubuntu.com
1 https://deb.torproject.org/torproject.org noble/main amd64 Packages
release o=TorProject,a=noble,n=noble,c=main,b=amd64
origin deb.torproject.org
Pinned packages:
deb.torproject.org-keyring -> 2025.08.08 with priority 500
tor -> 0.4.9.6-1~noble+1 with priority 500
tor-dbgsym -> 0.4.8.14-1+tpo1 with priority 500
tor-geoipdb -> 0.4.9.6-1~noble+1 with priority 500