apt when downloading packages from Ubuntu repositories. How can I check which kernel version was used when building package?
When it is important (kernel version of the build server vs. kernel version of the machine where package is installed)?
It's almost never important. If you're truly worried about the build system, you should consider the compiler, library and header versions before considering the kernel.
It is up to the code itself as to whether it 'remembers' the kernel version. Some packages store a string representing the compiler version, as this is far more important. In fact the kernel itself does this (see the contents of
I will not add anything about importance or not of knowing that kernel version since the comments and the answer above is fully explained.
But as an answer for your comment in the answer above
What about graphics drivers (kernel build vs run environment) ?
What you must care is the
gcc version that the kernel was compiled with so that you have to use same version with respect to your graphic drivers(Nvidia specially).
You need to
/proc/version file. This file identifies the kernel version that is currently running and
gcc version used to build the kernel.
$ cat /proc/version Linux version 3.2.0-23-generic (buildd@crested) (gcc version 4.6.3 (Ubuntu/Linaro 4.6.3-1ubuntu4) ) #36-Ubuntu SMP Tue Apr 10 20:39:51 UTC 2012
So as example start building NVIDIA module using gcc-4.6:
$ export CC=/usr/bin/gcc-4.6 $ bash NVIDIA-Linux-***.run