nerdexam
CompTIA

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.

Linux Installation and Package Management

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)
  • A
    2% (1)
  • B
    2% (1)
  • C
    4% (2)
  • D
    6% (3)
  • E
    87% (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.

A-bb

-bb instructs rpmbuild to build only the binary RPM package, which includes compiling and installing, not just unpacking and patching.

B-be

-be is not a recognized rpmbuild stage option and would produce an error.

C-bs

-bs instructs rpmbuild to build only the source RPM (.src.rpm), not to unpack and patch sources for inspection.

D-ba

-ba instructs rpmbuild to build both binary and source RPM packages, performing all stages including compile and install.

E-bpCorrect

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

#rpmbuild#RPM packaging#source patches#spec file stages

Community Discussion

No community discussion yet for this question.

Full LX0-103 Practice