源代码 RPM 包默认RHEL
安装在。我想使用选项来更改安装目录: ~/rpmbuild
--prefix
[root@nan nan]# rpm -ivvh --prefix=/home/nan kernel-3.10.0-290.el7.src.rpm
D: ============== kernel-3.10.0-290.el7.src.rpm
D: loading keyring from pubkeys in /var/lib/rpm/pubkeys/*.key
D: couldn't find any keys in /var/lib/rpm/pubkeys/*.key
D: loading keyring from rpmdb
D: opening db environment /var/lib/rpm cdb:0x401
D: opening db index /var/lib/rpm/Packages 0x400 mode=0x0
D: locked db index /var/lib/rpm/Packages
D: opening db index /var/lib/rpm/Name 0x400 mode=0x0
D: Expected size: 82747446 = lead(96)+sigs(180)+pad(4)+data(82747166)
D: Actual size: 82747446
D: kernel-3.10.0-290.el7.src.rpm: Header SHA1 digest: OK (96b97dc2dc445b69a5337a0df2c51aad0ec90e10)
D: added source package [0]
D: found 1 source and 0 binary packages
D: Expected size: 82747446 = lead(96)+sigs(180)+pad(4)+data(82747166)
D: Actual size: 82747446
D: kernel-3.10.0-290.el7.src.rpm: Header SHA1 digest: OK (96b97dc2dc445b69a5337a0df2c51aad0ec90e10)
Updating / installing...
1:kernel-3.10.0-290.el7 ################################# [100%]
D: ========== Directories not explicitly included in package:
D: 0 /root/rpmbuild/SOURCES/
D: 1 /root/rpmbuild/SPECS/
D: ==========
......
源代码仍然安装在~/rpmbuild
目录中。如何更改安装目录?
答案1
--prefix 仅适用于可重定位包,以更改二进制文件的目标目录
在您的情况下,您应该使用 --buildroot 参数。