LinuxQuestions.org
Latest LQ Deal: Complete CCNA, CCNP & Red Hat Certification Training Bundle
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Newbie
User Name
Password
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!

Notices


Reply
  Search this Thread
Old 04-19-2010, 01:15 PM   #1
parkarnoor
Member
 
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 again.so 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


thanks
noor
 
Old 04-20-2010, 08:56 AM   #2
bigrigdriver
LQ Addict
 
Registered: Jul 2002
Location: East Centra Illinois, USA
Distribution: Debian stable
Posts: 5,880

Rep: Reputation: 351Reputation: 351Reputation: 351Reputation: 351
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 SOURCES
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.
./kernel-2.6.18-53.el5.spec

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 08:57 AM.
 
  


Reply


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 03:10 AM
Manual nvidia install needs kernel source, unable to select source in YOU sirius57 Linux - Hardware 2 12-04-2007 05:11 PM
error running rpmbuild -ta on cups source.tar.gz involving openssh? possible? Nahmus Linux - Software 6 04-14-2007 02:20 AM
rpmbuild a kernel DigiCrime Linux - Kernel 19 10-04-2006 07:27 AM
rpmbuild doesn't produce the source code in /usr/src/redhat/BUILD Niceman2005 Linux - Software 2 11-29-2004 05:58 PM


All times are GMT -5. The time now is 01:02 AM.

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