Help answer threads with 0 replies.
Go Back > Forums > Linux Forums > Linux - Newbie
User Name
Linux - Newbie This Linux forum is for members that are new to Linux.
Just starting out and have a question? If it is not in the man pages or the how-to's this is the place!


  Search this Thread
Old 04-19-2010, 02:15 PM   #1
Registered: Apr 2010
Posts: 54

Rep: Reputation: 1
kernel source cannot install using rpmbuild

Dear all, here is my problem

i downloaded kernel source rpm. i.e kernel-2.6.18-53.el5.src.rpm for my kernel 2.6.18-53.el5.

i installed succeffully above src.rpm using command ..
rpmbuild --rebuild kernel-2.6.18-53.el5.src.rpm

it created a directory in /usr/src/redhat

then i manually deleted the redhat directory just because i want to rebuild the kernel source i i removed the redhat directory but now i tried to excute above rpmbuild command again but it is failed.

saying: error:cannot create %sourcedir /usr/src/redhat/sources
error:kernel-2.6.18-53.el5.src.rpm cannot be installed

may i know the reason why it is failing

Old 04-20-2010, 09:56 AM   #2
LQ Addict
Registered: Jul 2002
Location: East Centra Illinois, USA
Distribution: Debian stable
Posts: 5,903

Rep: Reputation: 353Reputation: 353Reputation: 353Reputation: 353
You should not delete /usr/src/redhat. That directory is needed for kernel compile. It should have 5 subdirectories: BUILD, RPMS, SOURCES, SPEC, and SRPMS.

kernel-2.6.18-53.el5.src.rpm is a source code rpm (.src.rppm) for the kernel, which must be compiled to get a binary rpm which you can install.

Su to root and make the necessary directories.
mkdir /usr/src/rednat
cd /usr/src/redhat
mkdir BUILD
mkdir RPMS
mkdir SPEC
mkdir SRPMS

Then install the kernel .src.rpm: rpm -i kernel-2.6.18-53.el5.src.rpm. That will place the kernel source tarball in /usr/src/redhat/SOURCES, and an rpm .spec file in /usr/src/redhat/spec. The .spec file is the rpm equivalent of a makefile which guides the compiling of the source code.

cd to SPEC
cd /usr/src/redhat/SPEC

compile the binary kernel rpm.

When the compile is complete, you will have a binary kernel rpm which you can install, assuming there are no errors during the compile. It will be in /usr/src/redhat/RPMS.

Then you can install that binary rpm.

Last edited by bigrigdriver; 04-20-2010 at 09:57 AM.


Thread Tools Search this Thread
Search this Thread:

Advanced Search

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off

Similar Threads
Thread Thread Starter Forum Replies Last Post
rpmbuild and kernel source code problem gr217 Linux - Server 7 01-19-2009 04:10 AM
Manual nvidia install needs kernel source, unable to select source in YOU sirius57 Linux - Hardware 2 12-04-2007 06:11 PM
error running rpmbuild -ta on cups source.tar.gz involving openssh? possible? Nahmus Linux - Software 6 04-14-2007 03:20 AM
rpmbuild a kernel DigiCrime Linux - Kernel 19 10-04-2006 08:27 AM
rpmbuild doesn't produce the source code in /usr/src/redhat/BUILD Niceman2005 Linux - Software 2 11-29-2004 06:58 PM > Forums > Linux Forums > Linux - Newbie

All times are GMT -5. The time now is 09:12 PM.

Main Menu
Write for LQ is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
Facebook: linuxquestions Google+: linuxquestions
Open Source Consulting | Domain Registration