I want to depend my deb package to current kernel version that is installed on machine.

for example if my kernel version is 3.13.0-77 my deb file depends on linux-headers-

if I add "linux-headers-$(uname -r)" to Depends field in debian/control file, dpkg-buildpackage returns an error in dpkg-gencontrol process.

how can I add this feature in my packaging?



Depends: linux-headers- (>=, linux-headers- (<<

$(uname -r) in this case does'nt cut it.

| improve this answer | |
  • thanks, but in this way when my kernel changed I must repackaging! – Mansour May 4 '16 at 5:05

I suggest that your dependency be linux-headers-generic since, if it is installed, the headers for the currently running kernel, no matter what it is, are also installed.

| improve this answer | |
  • thanks, but my repository has various version of Linux-headers, and this solution not good for me – Mansour May 4 '16 at 5:02

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.