2

I'm trying to compile my own kernel using this guide https://wiki.ubuntu.com/Kernel/BuildYourOwnKernel but when I'm issuing the first command

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

apt is informing me that it was not possible to find the source for packet linux, uname -r shows that the current kernel is linux-image-4.4.0-92-generic. The same thing happens when I'm issuing this command

sudo apt-get build-dep linux-image-$(uname -r)

What should I do to be able to compile my own version of the kernel? Is the ubuntu kernel compilation guide inappropriate for elementary os?

3

Please beware of building new kernels as if you don't get all the correct options for your hardware, your computer could stop booting. Though it should be possible to recover. The latest version of elementary now ships with kernal 4.10, so see if that meets your needs before building another.

However, if you still want to continue:

The apt-get source command will be failing because the Ubuntu source repositories are disabled in elementary OS. This reduces the network traffic needed when performing updates and does not affect 99% of users.

If you wish to re-enable those repositories, open /etc/apt/sources.list and remove the # symbol from the deb-src lines. You should only need to remove it from the two lines near the top of the file that end with xenial main restricted and xenial-updates main restricted.

Once you have done this, run sudo apt update and then the apt-get source commands should work as expected.

1

Try using the Ubuntu Kernel Update Utility; UKUU.

sudo apt-get install software-properties-common

sudo add-apt-repository ppa:teejee2008/ppa

sudo apt-get update

sudo apt-get install ukuu

That should open a list of kernels you can install. Don't update past 4.11.12

4.11.12-041112-generic x86_64

You will need to install the kernel, the reboot the computer, then install again (the first attempt never works), then reboot and your new kernel should load.

There is no support for several programs you go past 4.11.12-041112-generic x86_64. For example GCC and VMware will not work. Do not update past this kernel, this prevents little nuisances as that. Being bleeding edge is rarely necessary.

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.