Score:0

Install highest version of package providing given virtual

mx flag

We have hand-rolled debian packages in internal repos. The package has the version baked into the name because reasons, eg: driver-headers-8.12.12_8.12.12_amd64.deb

I want to always be able to install the latest / highest-versioned "driver-headers" package. So we make each one provide the nominal package name with matching version (in the debian/control):

Provide: driver-headers (= 8.12.12)

The problem comes when there are multiple versions in a repo a simple apt-get install driver-headers does not know which package to install since N packages are providing that virtual eg:

$ sudo apt-get install driver-headers
Reading package lists... Done
Building dependency tree
Reading state information... Done
Package driver-headers is a virtual package provided by:
  driver-headers-8.15.53-13-release 8.15.53-13.abcdef
  driver-headers-7.12.53-10 7.12.53-10.888666
  ...

It does however seem to know how to sort them correctly (the first displayed is the highest version).

Is this possible?

us flag
*It does however seem to know how to sort them correctly* -- Then what is your question? `apt` automatically downloads the latest available version.
mx flag
I thought about this more: it sorts correctly because their names all begin with the same thing. If another package (say aardvark) provided "drivers-headers", then it would sort before and they would no longer be "sorted correctly". Which is the crux of the problem: apt can't rely on a lexicographical sort of package names to determine which best fulfills a given virtual. I think a meta package is the solution here.
mangohost

Post an answer

Most people don’t grasp that asking a lot of questions unlocks learning and improves interpersonal bonding. In Alison’s studies, for example, though people could accurately recall how many questions had been asked in their conversations, they didn’t intuit the link between questions and liking. Across four studies, in which participants were engaged in conversations themselves or read transcripts of others’ conversations, people tended not to realize that question asking would influence—or had influenced—the level of amity between the conversationalists.