Linux

RHEL7核心原始碼安裝在哪裡?

  • July 7, 2015

我安裝Linux核心原始碼 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

安裝過程看似成功,但是使用rpm -ql kernel-3.10.0-229.el7.src命令找不到原始碼的安裝位置:

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

RHEL7核心原始碼安裝在哪裡?

更新:rpm -qa | grep kernel命令輸出:

[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

源包不會添加到 rpm 數據庫中,因此它們不會在查詢時顯示。

可能的位置是 ~/rpmbuild/{SOURCES,SPECS},其中 SOURCES 包含包源和分發更新檔,而 SPECS 子目錄包含用於建構包的 .spec 文件(有關詳細資訊,請參見 rpmbuild (8) 手冊頁)。

如果在那裡找不到源,請使用 -vv 選項重新安裝以檢查位置是否被覆蓋:

$ 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: ==========

引用自:https://unix.stackexchange.com/questions/214334