LinuxCommandLibrary

apt-config

Query APT configuration values

SYNOPSIS

apt-config [options] command [cmd-options]

PARAMETERS

-h, --help
    Display usage summary and exit.

-v, --version
    Output version information and exit.

-o, --option
    Override config: -o Foo::Bar=baz sets value temporarily.

-c, --config-file
    Specify alternate config file to read (-c file)

-q, --quiet
    Reduce output verbosity.

DESCRIPTION

apt-config is a command-line tool for inspecting, querying, and dumping the configuration used by the APT package manager on Debian and Ubuntu systems. It reads hierarchical configuration from /etc/apt/apt.conf and drop-in files in /etc/apt/apt.conf.d/, allowing users to view effective settings without manual parsing.

Primary uses include debugging package manager behavior, scripting config checks, and testing overrides. The tool supports pattern matching to output specific values, regex filtering for targeted dumps, and an interactive shell for dynamic evaluation of config expressions like Apt::Get::Assume-Yes.

For example, apt-config dump prints the full config tree, while apt-config dump Dir::Etc::sourcelist shows a single value. Overrides via -o enable temporary changes for testing. It's essential for advanced APT administration, ensuring transparency into options affecting apt-get, apt-cache, and related tools.

Configuration is structured as a tree with qualified names (e.g., Acquire::http::Proxy), supporting lists, maps, and booleans. This utility does not modify files—only reads and displays.

CAVEATS

Does not modify configurations; read-only. Some options inherited from APT may vary by version. Use apt for user-facing tasks in modern systems.

SUBCOMMANDS

dump [pattern]: Dump full or matched config.
shell [pkg [var]]: Interactive config evaluator.
filter regex: Regex-filtered dump.
filter-aptindices file: Process index files.

EXAMPLES

apt-config dump: Full config.
apt-config shell Acquire::http Proxy: Query proxy interactively.
apt-config -o Dir::Etc::SourceList=/tmp/list dump: Override and dump.

HISTORY

Developed as part of APT 0.3 (1998), matured in APT 0.6 (2002). Remains core to Debian/Ubuntu package management, with enhancements for shell/filter in later versions like APT 1.0+.

SEE ALSO

apt(8), apt-get(8), apt-cache(8), dpkg(1)

Copied to clipboard