# /usr/src/linux question

## rommel

i have now in/usr/src the linux directory and then 2 gentoo source directories and a linux sources directory...how do you get rid of them adn leave the most recent...i have a linux-2.4.19-rc1 , linux-2.4.19-gentoo-rc1 and from the most recent update linux-2.4.19-gentoo-rc3...my kernel is compiled using the gentoo-rc1

----------

## Guest

I'm not sure I understand... are you looking for something other than "rm -rf"?

The linux directory should be a symbolic link to one of the other directories (probably linux-2.4.19...rc1).  You don't really need to delete it, just have it point somewhere valid.

All I can suggest is don't clean up the "old" directory before you compile and verify a new kernel  :Wink: 

----------

## rommel

yeah its pointing to gentoo-rc1...thats what my current kernel is compiled against...but how do i point it to the newer gentoo directory...as of 3 mins ago rc-4 now...lol

edit:

wait is it as simple as editing the Makefile in the linux directory and setting the extraversion to ue gentoo-rc4 instead of rc-1?

----------

## AutoBot

Safest way would be:

```

emerge unmerge <current-kernel>

cd /usr/src

rm -rf sources.you.dontwant-2.x.x

rm linux

emerge rsync

emerge gentoo-sources

cd linux

make dep && make clean bzImage modules modules_install

```

Reason I say cd is because rm -rf could go horribly wrong if you accidently did it in the wrong way, basically your /usr/src directory should be empty other than perhaps a pc directory before you emerge gentoo-sources.

----------

## zerogeny

before you got deleting your sources, i would emerge the newer source and test it before  :Smile: 

----------

## rommel

well let me ask this....instead of trashing everything right out can i just point the Makefile in the linux directory to go to the newest r-4 sources directory and compile a kernel and see how it works....or will the presence of all the older sources and i guess previous symbolic links not let the compile work properly?

oh crap i'll just try it....lol....i took longer to type this then run config

edit:

well i ran config with just the 'extraversion= -gentoo-r4' line changed in the gentoo-r1 sources directory and it comiled ok and i am runinng it now ...if i type #uname -r it tells  me 2.4.19-gentoo-r4

so did this work or by changing the extraversion= line did i just change what it tells you it is...lol

----------

## friedmud

Wouldn't an:

```
emerge clean
```

clean out the old ones and just leave the newest??

Derek

----------

## MacMasta

Is there any reason that

```
rm linux

ln -s (target) linux

```

woudn't work?

~Mac~

----------

