the first time I ran rpi-source (https://github.com/notro/rpi-source/wiki) I had no trouble at all getting the hello world kernel module to run.

I deleted the kernel headers, and when I now run rpi-source, it proceeds to ask me hundreds of questions about my kernel config (after headers have been unpacked), which it did not the first time. I don't know what to answer to all those questions. If I keep enter pressed for all questions I cannot compile the hello world code any more:

/bin/sh: 1: scripts/mod/modpost: not found
make[1]: *** [__modpost] Error 127
make: *** [modules] Error 2

How can I get back to the behaviour where it generated the config automatically?

2 Answers 2


The kernel headers are usually installed via the package manager apt. If you manually removed them then the package manager will still think you have them installed you need to reinstall.

do aptitude search linux-header lines beginning with i show install packages.

then sudo aptitude reinstall linux-header… probably just sudo aptitude reinstall linux-header for the default kernel.


When rpi-source is run and the source is installed, it says so and quits:

$ rpi-source
 *** Kernel source already installed: /home/pi/linux-342abe67d0e1f12eae17562bfe7615143d2618d1


Deleting this directory, makes rpi-source unpack and prepare the source again:

$ rm -rf /home/pi/linux-342abe67d0e1f12eae17562bfe7615143d2618d1
$ rpi-source
 *** Download kernel source: Already downloaded /home/pi/linux-342abe67d0e1f12eae17562bfe7615143d2618d1.tar.gz

 *** Unpack kernel source

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

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