6

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 ?

3
  • if not ... difyel.com/linux/etc/apt/preferences
    – Rinzwind
    Commented Jun 17, 2021 at 19:25
  • @user535733, not before asking - but now I did: Seems preferences.d is for *.pref files that contain preferences for packages, but preferences for apt-config must go into apt.conf.d/*.conf. Maybe the word "preferences" was misleading for me. If this is the correct answer, please write it as an answer and I would accept it.
    – Juergen
    Commented Jun 17, 2021 at 19:38
  • OK, did not reach you, so writing this as my own answer.
    – Juergen
    Commented Jun 17, 2021 at 19:55

1 Answer 1

8

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 with
Ignoring file 'somefile.conf' in directory '/etc/apt/preferences.d/' as it has an invalid filename extension.

1
  • 1
    Glad to see you figured it out.
    – user535733
    Commented Jun 17, 2021 at 21:33

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .