Find the answer to your Linux question:
Results 1 to 10 of 10
Hi, I'm using centos 6.4 with kernel 2.6.32-358.6.2.el6.x86_64. I think I accidentally removed kernels directory in /usr/src and now I need this. How can I get this? Thank you...
Enjoy an ad free experience by logging in. Not a member yet? Register.
  1. #1
    Just Joined!
    Join Date
    Nov 2013
    Posts
    5

    kernel sources not found


    Hi,
    I'm using centos 6.4 with kernel 2.6.32-358.6.2.el6.x86_64.
    I think I accidentally removed kernels directory in /usr/src and now I need this.
    How can I get this?
    Thank you

  2. #2
    Administrator MikeTbob's Avatar
    Join Date
    Apr 2006
    Location
    Texas
    Posts
    7,864
    Quote Originally Posted by ggirodda View Post
    Hi,
    I'm using centos 6.4 with kernel 2.6.32-358.6.2.el6.x86_64.
    I think I accidentally removed kernels directory in /usr/src and now I need this.
    How can I get this?
    Thank you
    Welcome to the forums.
    You should be able to use your package manager to install the kernel sources. If you need to compile a kernel driver module, chances are you do not really need the full kernel source tree. You might just need the kernel-devel package.

    Code:
    yum -y install kernel-devel
    See this link.
    HowTos/I need the Kernel Source - CentOS Wiki
    I do not respond to private messages asking for Linux help, Please keep it on the forums only.
    All new users please read this.** Forum FAQS. ** Adopt an unanswered post.

    I'd rather be lost at the lake than found at home.

  3. #3
    Just Joined!
    Join Date
    Nov 2013
    Posts
    5
    Thank you for the imminent answer,
    I already try with installing kernel-devel, but I get this

    Loaded plugins: fastestmirror, refresh-packagekit
    Loading mirror speeds from cached hostfile
    * base: miroir.univ-paris13.fr
    * extras: centos.mirror.fr.planethoster.net
    * piaf64: 192.210.137.132
    * updates: centos.mirror.fr.planethoster.net
    Setting up Install Process
    Nothing to do


    and I already read this guide but I have still the same problem...
    This is the output when I try to install dahdi that requires kernel sources

    make -C linux all
    make[1]: Entering directory `/usr/src/dahdiPatched/linux'
    make -C drivers/dahdi/firmware firmware-loaders
    make[2]: Entering directory `/usr/src/dahdiPatched/linux/drivers/dahdi/firmware'
    make[2]: Leaving directory `/usr/src/dahdiPatched/linux/drivers/dahdi/firmware'
    You do not appear to have the sources for the 2.6.32-358.6.2.el6.x86_64 kernel installed.
    make[1]: *** [modules] Error 1
    make[1]: Leaving directory `/usr/src/dahdiPatched/linux'
    make: *** [all] Error 2

  4. #4
    Administrator MikeTbob's Avatar
    Join Date
    Apr 2006
    Location
    Texas
    Posts
    7,864
    Hmmm. Apparently they are installed already just going by your first output.
    Post the ouput of
    Uname -a

    Sent from my SPH-D710VMUB using Tapatalk
    I do not respond to private messages asking for Linux help, Please keep it on the forums only.
    All new users please read this.** Forum FAQS. ** Adopt an unanswered post.

    I'd rather be lost at the lake than found at home.

  5. #5
    Just Joined!
    Join Date
    Nov 2013
    Posts
    5
    Linux pbx.local 2.6.32-358.6.2.el6.x86_64 #1 SMP Thu May 16 20:59:36 UTC 2013 x86_64 x86_64 x86_64 GNU/Linux

  6. #6
    Administrator MikeTbob's Avatar
    Join Date
    Apr 2006
    Location
    Texas
    Posts
    7,864
    You need to follow the link and try step 2. I think you need the actual kernel sources and not devel.

    Sent from my SPH-D710VMUB using Tapatalk
    I do not respond to private messages asking for Linux help, Please keep it on the forums only.
    All new users please read this.** Forum FAQS. ** Adopt an unanswered post.

    I'd rather be lost at the lake than found at home.

  7. #7
    Trusted Penguin
    Join Date
    May 2011
    Posts
    4,353
    Quote Originally Posted by ggirodda View Post
    I already try with installing kernel-devel, but I get this

    Code:
    Loaded plugins: fastestmirror, refresh-packagekit
    Loading mirror speeds from cached hostfile
     * base: miroir.univ-paris13.fr
     * extras: centos.mirror.fr.planethoster.net
     * piaf64: 192.210.137.132
     * updates: centos.mirror.fr.planethoster.net
    Setting up Install Process
    Nothing to do
    it sounds like you manually deleted the files, but the RPM database still has a record of the package being installed. yum won't install a package that is already installed (or maybe it does, i've never looked ...) but you can trick it into thinking it is removed by just removing the record of the RPM being installed in the RPM database.

    do that like this, in a terminal (as root):

    Code:
    rpm -e --justdb kernel-devel
    that will remove just the package's entry in the db, and leave all actual files alone (although in your case, most of those are gone anyway).

  8. #8
    Just Joined!
    Join Date
    Nov 2013
    Posts
    5
    Ok I do that, and now I need to reinstall kernel-devel?
    I try yum install kernel-devel, but now I get this

    No package kernel-devel available.
    Error: Nothing to do

  9. #9
    Just Joined!
    Join Date
    Nov 2013
    Posts
    5
    OK, I install it from rpm and now that works

    Thank you !!!

  10. #10
    Trusted Penguin
    Join Date
    May 2011
    Posts
    4,353
    glad you got it sorted...but food for thought: if you have the time, you should figure out why yum did not think that package was available for install on your system. it is best to not directly install using RPM, when at all possible. one reason that leaps to mind is, when your system is updated using "yum update" or "yum update kernel", you might get breakage.

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •