Linux Administration
medium

Questão de Linux Administration #019e3987

Enunciado da Questão
Linux Administration
#sources.list
#apt
#debian-repositories
#package-management
Médio

Which file should be edited to select the network locations from which Debian installation package files are loaded?

A

/etc/dpkg/dpkg.cfg

B

/etc/apt/apt.conf

C

/etc/apt/apt.conf.d

D

/etc/apt/sources.list

Correta
E

/etc/dpkg/dselect.cfg

Explicação Oficial / Explicações da Comunidade

The file /etc/apt/sources.list is the correct configuration file for specifying the network locations (repositories) from which Debian installation packages are loaded. This file contains lines that define the APT repositories, including the URI, distribution, and components (e.g., main, contrib, non-free). APT reads this file to fetch package lists and install packages from the specified sources.

How it Works

APT (Advanced Package Tool) uses the sources defined in /etc/apt/sources.list and files in /etc/apt/sources.list.d/ to retrieve package metadata and .deb packages. Each line in sources.list follows the format: deb [options] uri distribution [components]. For example: deb http://deb.debian.org/debian bookworm main. When you run apt update, APT downloads the package lists from these URIs and updates its local cache.

Why the Correct Value is Right

  • /etc/apt/sources.list: This is the primary configuration file for APT repositories. It directly defines where packages are obtained. Editing this file allows you to add, remove, or change package sources.

Why the Incorrect Values are Wrong

  • /etc/dpkg/dpkg.cfg: This file configures the behavior of dpkg, the low-level package manager. It does not define package sources; it controls options like logging, architecture, and selection of packages.
  • /etc/apt/apt.conf: This file configures APT's general behavior, such as proxy settings, caching, and authentication. It does not specify repository locations.
  • /etc/apt/apt.conf.d: This is a directory containing configuration snippets for APT. While it can influence APT behavior, it is not the file that directly lists package sources. Repository definitions belong in sources.list or sources.list.d/.
  • /etc/dpkg/dselect.cfg: This file configures dselect, a front-end to dpkg. It does not define package sources; dselect relies on APT or other methods for source configuration.