nerdexam
CompTIA

XK0-005 · Question #362

An administrator is logged on as an unprivileged user and needs to compile and installed an application from source. Which of the following BEST represents how to complete this task?

The correct answer is A. cd <source>; sudo ./configure $$ make $$ make install. When compiling and installing an application from source as an unprivileged user, the make install step requires sudo privileges to write to system directories.

System Management

Question

An administrator is logged on as an unprivileged user and needs to compile and installed an application from source. Which of the following BEST represents how to complete this task?

Options

  • Acd <source>; sudo ./configure $$ make $$ make install
  • Bcd <source>; ./configure $$ sudo make $$ make install
  • Ccd <source>; ./configure $$ make $$ make install
  • Dcd <source>; ./configure $$ make $$ make install

How the community answered

(56 responses)
  • A
    82% (46)
  • B
    4% (2)
  • C
    11% (6)
  • D
    4% (2)

Why each option

When compiling and installing an application from source as an unprivileged user, the `make install` step requires `sudo` privileges to write to system directories.

Acd <source>; sudo ./configure $$ make $$ make installCorrect

The standard process for compiling from source involves `./configure` to prepare the build, `make` to compile the code, and `make install` to copy the compiled binaries and files to system-wide locations. While `./configure` and `make` typically run without elevated privileges, `make install` usually requires root permissions to write to privileged directories such as `/usr/local/bin` or `/usr/lib`, hence the necessity of `sudo make install`.

Bcd <source>; ./configure $$ sudo make $$ make install

Placing `sudo` before `make` is generally unnecessary because the compilation step does not typically require root privileges.

Ccd <source>; ./configure $$ make $$ make install

Performing all steps as an unprivileged user will likely result in a permission denied error during the `make install` phase when attempting to write to system directories.

Dcd <source>; ./configure $$ make $$ make install

This option is identical to C, performing all steps as an unprivileged user, and will similarly fail during the `make install` phase due to insufficient permissions.

Concept tested: Compiling from source; sudo for installation

Source: https://tldp.org/HOWTO/Program-Library-HOWTO/shared-libs.html

Topics

#Software Compilation#Package Installation#Privilege Escalation#Linux Commands

Community Discussion

No community discussion yet for this question.

Full XK0-005 Practice