2

I install the Linux kernel source code RPM:

[root@localhost ~]# rpm -ivh kernel-3.10.0-229.el7.src.rpm
warning: kernel-3.10.0-229.el7.src.rpm: Header V3 RSA/SHA256 Signature, key ID f4a80eb5: NOKEY
Updating / installing...
   1:kernel-3.10.0-229.el7            ################################# [100%]
warning: user builder does not exist - using root
warning: group builder does not exist - using root
warning: user builder does not exist - using root
warning: group builder does not exist - using root
warning: user builder does not exist - using root
warning: group builder does not exist - using root
warning: user builder does not exist - using root
warning: group builder does not exist - using root
warning: user builder does not exist - using root
warning: group builder does not exist - using root
warning: user builder does not exist - using root
warning: group builder does not exist - using root
warning: user builder does not exist - using root
warning: group builder does not exist - using root
warning: user builder does not exist - using root
warning: group builder does not exist - using root
warning: user builder does not exist - using root
warning: group builder does not exist - using root
warning: user builder does not exist - using root
warning: group builder does not exist - using root
warning: user builder does not exist - using root
warning: group builder does not exist - using root
warning: user builder does not exist - using root
warning: group builder does not exist - using root
warning: user builder does not exist - using root
warning: group builder does not exist - using root
warning: user builder does not exist - using root
warning: group builder does not exist - using root
warning: user builder does not exist - using root
warning: group builder does not exist - using root
warning: user builder does not exist - using root
warning: group builder does not exist - using root
warning: user builder does not exist - using root
warning: group builder does not exist - using root
warning: user builder does not exist - using root
warning: group builder does not exist - using root
warning: user builder does not exist - using root
warning: group builder does not exist - using root
warning: user builder does not exist - using root
warning: group builder does not exist - using root
warning: user builder does not exist - using root
warning: group builder does not exist - using root
warning: user builder does not exist - using root
warning: group builder does not exist - using root
warning: user builder does not exist - using root
warning: group builder does not exist - using root
warning: user builder does not exist - using root
warning: group builder does not exist - using root
warning: user builder does not exist - using root
warning: group builder does not exist - using root
warning: user builder does not exist - using root
warning: group builder does not exist - using root
warning: user builder does not exist - using root
warning: group builder does not exist - using root
warning: user builder does not exist - using root
warning: group builder does not exist - using root
warning: user builder does not exist - using root
warning: group builder does not exist - using root
warning: user builder does not exist - using root
warning: group builder does not exist - using root
warning: user builder does not exist - using root
warning: group builder does not exist - using root

The installation process seems success, but using rpm -ql kernel-3.10.0-229.el7.src command can't find where the source code is installed:

[root@localhost ~]# rpm -ql kernel-3.10.0-229.el7.src
package kernel-3.10.0-229.el7.src is not installed

Where is the RHEL7 kernel source code installed?

Update: rpm -qa | grep kernel command ouput:

[root@localhost ~]# rpm -qa | grep kernel
kernel-headers-3.10.0-229.el7.x86_64
kernel-devel-3.10.0-229.el7.x86_64
kernel-3.10.0-229.el7.x86_64
kernel-tools-libs-3.10.0-229.el7.x86_64
abrt-addon-kerneloops-2.1.11-19.el7.x86_64
kernel-tools-3.10.0-229.el7.x86_64
  • Add output of "rpm -qa|grep kernel", just to show what is actually installed ? – steve Jul 7 '15 at 7:58
2

Source packages are not added to the rpm database, so they will not show on query.

Probable location is ~/rpmbuild/{SOURCES,SPECS} with SOURCES containing the package sources and distribution patches while the SPECS subdirectory containing the .spec file being used to build the package (see rpmbuild (8) man page for details).

If you can't find the sources there, than reinstall with the -vv option to check the location if it's overwritten:

$ rpm -ivvh kernel-3.10.0-229.7.2.el7.src.rpm 
--- snip ---
Updating / installing...
   1:kernel-3.10.0-229.7.2.el7        ################################# [100%]
D: ========== Directories not explicitly included in package:
D:          0 /home/user/rpmbuild/SOURCES/
D:          1 /home/user/rpmbuild/SPECS/
D: ==========
  • Yes, you are right! Thanks! BTW, why there are so many warnings when installing kernel*.*.src.rpm? – Nan Xiao Jul 7 '15 at 8:58
  • 1
    There's actually only one warning that is repeated for every file that is created. The rpm says that the files must belong to user "builder" (the account used by redhat for developing). Since this user does not exists in the current system the files will be created as the default user "root" or if you run the command as normal user, the user running the command and display a warning. – nkms Jul 7 '15 at 9:13
0

It should be under /usr/src/kernel.

if you dont find it, you can try

rpm -qa| grep -w kernel-devel

rpm -ql kernel-devel-x.x.x.x.x

This will give you the location of files installed by kernel rpm.

Bye the way, kernel source should be installed with kernel-devel package, rather kernel-x.x.x.x

  • What is the difference between kernel and kernel-devel? – Nan Xiao Jul 7 '15 at 8:05
  • try rpm -ql kernel-3.10.0-229.el7.x86_64 – Aaghaz Jul 7 '15 at 8:05
  • kernel-devel is actually not full source code, but contains enough to compile modules. – Aaghaz Jul 7 '15 at 8:06

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.