LX0-103 · Question #29
When building an RPM package, which rpmbuild option is used to unpack sources and apply patches before proceeding with the next steps?
The correct answer is E. -bp. The rpmbuild -bp option executes only the %prep section of the spec file, which unpacks source archives and applies patches without proceeding to compile or install steps.
Question
When building an RPM package, which rpmbuild option is used to unpack sources and apply patches before proceeding with the next steps?
Options
- A-bb
- B-be
- C-bs
- D-ba
- E-bp
How the community answered
(54 responses)- A2% (1)
- B2% (1)
- C4% (2)
- D6% (3)
- E87% (47)
Why each option
The rpmbuild -bp option executes only the %prep section of the spec file, which unpacks source archives and applies patches without proceeding to compile or install steps.
-bb instructs rpmbuild to build only the binary RPM package, which includes compiling and installing, not just unpacking and patching.
-be is not a recognized rpmbuild stage option and would produce an error.
-bs instructs rpmbuild to build only the source RPM (.src.rpm), not to unpack and patch sources for inspection.
-ba instructs rpmbuild to build both binary and source RPM packages, performing all stages including compile and install.
The -bp flag tells rpmbuild to stop after the %prep stage, which handles source extraction (typically via %setup) and patch application (via %patch directives). This is useful for inspecting the source tree after patching but before any compilation occurs. It is the standard option for verifying that sources unpack and patch cleanly.
Concept tested: rpmbuild spec file stage options
Source: https://rpm.org/documentation.html
Topics
Community Discussion
No community discussion yet for this question.