# kernel linking to linux

## Chickpea

I am having trouble linking my new kernel to linux  I have tried what I thought to be correct:

ln -sf new_kernel linux yet when I do a ls -l the old kernel is still linked tot he linux file. 

So I am wondering:  am I doing this incorrectly or is it because I did a stage 3 install? 

All help appreciated.

Thanks

C

----------

## craftyc

Do this and all (should) be solved

```
cd /usr/src

mv linux linux.OLD

ln -s /path/to/new/kernel linux

```

Unless I misread the post.

 :Smile: 

----------

## enesideme

you have to remove first the previous symbolik link. For instance rm /usr/src/linux if linux is the link to your kernel directory

and then ln -s /usr/src/linux-2xxx /usr/src/linux. But I would say you should not unpack the sources of your new kernel in /usr/src/ and make a link. It's better to unpack in your home directory for instance. Read the doc of the kernel. And what linus Torvalds said:

"I would suggest that people who compile new kernels should:

-not have a single symbolic link in sight (except the one that the kernel build itself sets up,namely the "linux/include/asm" symlink that is only used for the internal compile itself)

And yes this is what I do.My /usr/src/linux still has the old 2.2.13 header files,even though I haven't run a 2.2.13 kernel in a long time.But those headers were what glibc was compiled against,so those headers are what matches the library object files.

And this is actually what has been the suggested environement for at least the last five years. I don't know why the symlink business keeps on living on, like a bad zombie. pretty much every distribution still has that broken symlink and people still remember that the linux sources should go into "/usr/src/linux" even though that hasn't been true in a long time.

I hope it's clear enough

----------

