What is the purpose of the /etc/apt/preferences.d directory in Ubuntu?
When I put some apt config file into /etc/apt/preferences.d
of my Ubuntu 20 LTS desktop, it is ignored (cannot be seen in the output of apt-config dump
).
When I instead put the same *.conf
file into the /etc/apt/apt.conf.d
directory, it is honored (can be seen in the output of apt-config dump
).
So what is the purpose of the /etc/apt/preferences.d
directory in Ubuntu ?
According to man apt_preferences
, the directory /etc/apt/preferences.d
is for *.pref
files that contain preferences for packages, but preferences for apt-config
must go into apt.conf.d/*.conf
.
apt-config
ignores wrong *.conf
files in /etc/apt/preferences.d
, but apt-get install
warns withIgnoring file 'somefile.conf' in directory '/etc/apt/preferences.d/' as it has an invalid filename extension
.