nerdexam
Linux_Foundation

LFCS · Question #842

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 command is specifically used during RPM package creation to prepare the build environment by unpacking source files and applying any patches defined in the spec file.

Submitted by amina.ke· Apr 18, 2026Essential Commands

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

(58 responses)
  • B
    2% (1)
  • C
    2% (1)
  • D
    3% (2)
  • E
    93% (54)

Why each option

The `rpmbuild -bp` command is specifically used during RPM package creation to prepare the build environment by unpacking source files and applying any patches defined in the spec file.

A-bb

`rpmbuild -bb` (build binary) compiles the package and creates the binary RPM, skipping the prep phase if not already done.

B-be

`rpmbuild -be` (build execute) executes the `%build` section of the spec file, which typically involves compiling the source code.

C-bs

`rpmbuild -bs` (build source) builds only the source RPM package, not unpacking or patching the sources.

D-ba

`rpmbuild -ba` (build all) performs a complete build, creating both source and binary RPMs, but `-bp` specifically targets the prep stage.

E-bpCorrect

E is correct because `rpmbuild -bp` (build prep) executes the `%prep` section of the RPM spec file, which includes unpacking the source tarball and applying any specified patches, making it ready for the compilation phase. This step is crucial for preparing the source code before compilation or other build stages.

Concept tested: RPM package build stages

Source: https://rpm.org/documentation/build_system/rpmbuild.html

Topics

#RPM#Package building#rpmbuild#Build stages

Community Discussion

No community discussion yet for this question.

Full LFCS Practice