On 2023-03-27 at 20:03, Ram Ramesh wrote:

> I have nvdia card that requires binary driver to work in my system.
> Xorg is unable display anything with free driver. Since nvidia-driver
> has to be built for each kernel install, I need to install headers
> also. This seem to work automatically for any standard kernel release
> in bullseye. However when I install newer kernel from backport, apt
> does not install headers automatically. How do I tie the install of
> linux-image to linux-header so that I cannot install image without
> the headers.

If I understand you correctly, you want to set it up so that for every
package pair

linux-image-<version>
linux-headers-<version>

attempting to install the former results in also installing the latter?
And you want this to apply not just for a specific version number, but
for every version number, including ones that haven't come out yet?


Just off the top of my head, I don't think there's any way to accomplish
that. The only possible avenue I can think of for adding an effective
dependency to a package - without modifying its source and rebuilding it
- is by making a custom metapackage (with custom dependencies) via
equivs, and I don't think there's a way to do that with enough dynamic
adjustment for this scenario.

I think you'll probably need to just deal with specifying the install of
the headers package explicitly when you install the image package.

Unless the image package is coming in automatically, by dependency from
e.g. the generic linux-image or linux-image-<arch> package, when you
upgrade that package? In that case you might consider also installing
the generic linux-headers (or linux-headers-<arch>) package, and
upgrading both of them at once, so that when there's a new image package
there will also be a new headers package at the same time.

That's a workaround, though, and doesn't actually do quite exactly what
you asked for.

-- 
   The Wanderer

The reasonable man adapts himself to the world; the unreasonable one
persists in trying to adapt the world to himself. Therefore all
progress depends on the unreasonable man.         -- George Bernard Shaw

Attachment: signature.asc
Description: OpenPGP digital signature

Reply via email to