brewedbits.dev

Personal blog with guides and news on selfhosting, Linux and AI, from the Netherlands

nextDash nextdash --aboutYour bookmarks. Your terminal. checks your links knows your Docker host one container, no cloudLive demo →nextdash.cc ↗

Tip: apt-config dump shows the apt settings that are really in effect

Apt
~/tips/tip-apt-config-dump

apt-config dump | less

Prints the merged configuration from every file in apt.conf.d.

apt reads its settings from many small files in /etc/apt/apt.conf.d/, and packages add their own. When apt behaves differently from what you expect, apt-config dump shows the final result.

It prints every setting as apt sees it after reading all files:

apt-config dump | less
apt-config dump | grep -i -E 'recommends|periodic|unattended'
apt-config dump APT::Install-Recommends

The second line is the most useful one, I think. It shows whether recommends get installed, and how the automatic update timers are set, like APT::Periodic::Update-Package-Lists and APT::Periodic::Unattended-Upgrade. A value of "0" there means that job is off.

The last form gives one setting with its subtree. It’s quicker than grepping when you know the exact name.

To find which file sets a value, grep the folder:

grep -r Install-Recommends /etc/apt/apt.conf.d/

Files are read in alphabetical order and a later file wins, so 99local beats 20auto-upgrades. That’s also why I’d give your own changes a high number.

The dump shows the configuration for apt itself. Options you pass with -o on the command line only apply to that one run, and unattended-upgrades has some settings of its own in 50unattended-upgrades, which do appear in the dump under Unattended-Upgrade::.

Further reading: apt-config(8) manual page, apt.conf(5) manual page

More Apt tips sudo apt-mark minimize-manual apt list '~c' grep -E ' (install|upgrade|remove) ' /var/log/dpkg.log | tail -o Dpkg::Options::="–force-confold" upgrade sudo apt-get -d -y full-upgrade All Apt tips (42) All topics

Link