2

Probably I am missing something obvious. This gives:

apt-get source linux-image-$(uname -r) Reading package lists... Done Picking 'linux' as source package instead of 'linux-image-4.4.0-47-generic' E: Unable to find a source package for linux

And:

apt-get build-dep linux-image-$(uname -r) Reading package lists... Done Picking 'linux' as source package instead of 'linux-image-4.4.0-47-generic' E: Unable to find a source package for linux-image-4.4.0-47-generic

  • Do you have the source respositories enabled? It should work the way you suggest... – lemonslice Nov 25 '16 at 6:07
  • Yes, you're right. That was the problem. Thanks. – Jonathan Coleman Nov 26 '16 at 0:19
  • Suggestion: If you think that your question has been answered, you might want to accept it. Feel free to correct it as well if needed. – lemonslice Nov 27 '16 at 9:53
  • If @lemonslice answer solved your problem, should you accept it so other users can use it as reference? – Jorge R. Marín Nov 27 '16 at 9:54
1

To install kernel source you have to enable source repositories, that is have a deb-src line that corresponds to the main repository deb line in the /etc/apt/sources.list file. For instance,

deb http://fr.archive.ubuntu.com/ubuntu/ xenial main restricted
deb-src http://fr.archive.ubuntu.com/ubuntu/ xenial main restricted

After you can get the kernel source of the actual running kernel with

apt update
apt source linux-image-$(uname -r)

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.