nerdexam
LPI

201-450 · Question #178

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. Option E (-bp) is correct because the -bp flag tells rpmbuild to execute only through the %prep section of the spec file - which is precisely where sources are unpacked (via %setup) and patches are applied (via %patch). This makes it ideal for inspecting the source tree before…

207 System Maintenance

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-ba
  • B-bb
  • C-be
  • D-bs
  • E-bp

How the community answered

(22 responses)
  • A
    5% (1)
  • B
    18% (4)
  • D
    5% (1)
  • E
    73% (16)

Explanation

Option E (-bp) is correct because the -bp flag tells rpmbuild to execute only through the %prep section of the spec file - which is precisely where sources are unpacked (via %setup) and patches are applied (via %patch). This makes it ideal for inspecting the source tree before compilation begins.

Why the distractors are wrong:

  • -ba builds everything: both the binary RPM and source RPM (all stages).
  • -bb builds only the binary RPM, running all stages through %install.
  • -be executes through the %check section, running tests after compilation.
  • -bs builds only the source RPM without ever compiling anything.

Memory tip: Think of the letter as mapping to the spec file stage it stops at - p for %prep, c for %compile, i for %install, a for all. If you need to "peek at the patched source," use -bp.

Topics

#RPM#rpmbuild#package building#spec file

Community Discussion

No community discussion yet for this question.

Full 201-450 Practice