CompTIA A+ Core 2 (220-1202)Operating SystemsHard

A developer is setting up a new Linux development environment. They need to install a specific package that is not available in the default repositories and requires compiling from source. After downloading the source code, which common command-line tool or sequence of commands is typically used to configure, compile, and install software from source in a Linux environment?

  1. Adpkg -i <package_name>.deb
  2. Byum install <package_name>
  3. C./configure && make && make install
  4. Dapt install <package_name>
Show answer & explanation

Correct answer: C. ./configure && make && make install

The sequence './configure && make && make install' is the standard method for compiling and installing software from source code in most Unix-like operating systems, including Linux. These commands handle the configuration for the local system, compilation, and final installation.

Why the other options are wrong

  • A. dpkg -i is used for installing individual .deb package files on Debian-based systems, not for compiling from source.
  • B. yum install is used for installing pre-compiled packages from repositories on Red Hat-based systems.
  • D. apt install is used for installing pre-compiled packages from repositories on Debian-based systems.

Compiling from Source (Linux)

The process of taking software source code, configuring it for the local system, compiling it into executable binaries, and then installing it, typically using a sequence of command-line tools.

  • Requires development tools (compiler, libraries).
  • Provides flexibility and access to latest versions.
  • More complex than installing pre-compiled packages.

Memory trick: Source Code: 'Configure', 'Make', then 'Install'!

More Operating Systems questions