[Date Prev][Date Next] [Thread Prev][Thread Next] [Date Index] [Thread Index]

Using /etc/apt/*.d directories



I've kind of ignored this since what I had was working, plus I haven't found any docs on it. At some point (lenny?), debian transitioned from monolithic files to breaking them up into smaller files in their .d directories. Specifically, I wanted to know best practices with /etc/apt/apt.conf and /etc/apt/sources.list. I will take each in turn.

My /etc/apt/apt.conf is fairly simple, an example one from my workstation looks like:

APT::Default-Release "unstable";
DPkg::Post-Invoke {
"debsums --generate=nocheck -sp /var/cache/apt/archives";
};

However, in /etc/apt/apt.conf.d, I have the following files:

-rw-r--r-- 1 root root 40 May 9 2008 00trustcdrom
-rw-r--r-- 1 root root 409 Feb 14 15:47 01autoremove
-rw-r--r-- 1 root root 129 May 5 2010 10periodic
-rw-r--r-- 1 root root 129 May 9 2008 15adept-periodic-update
-rw-r--r-- 1 root root 100 Aug 2 2010 15update-stamp
-rw-r--r-- 1 root root 85 May 5 2010 20archive
-rw-r--r-- 1 root root 141 Oct 9 2008 20listchanges
-rw-r--r-- 1 root root 1169 Aug 2 2010 50unattended-upgrades
-rw-r--r-- 1 root root 182 May 9 2008 70debconf
-rw-r--r-- 1 root root 127 Dec 21 2009 90debsums
-rw-r--r-- 1 root root 231 May 5 2010 99update-notifier

Now does the order of the files in conf.d make a difference or are all of them read in order? The last line of my apt.conf is covered in 90debsums, however, where to put the Default-Release? Should that go after the trustcdrom or does it matter?

The reason I need the Default-Release is that I generally keep stanzas for all of the releases in my sources.list. The way I have done it (since I think sources.list.d came about before apt.conf.d, but I'm not sure), is to have a master sources.list, which contains _only_ Debian sources (stable, testing, unstable and sometimes experimental), and then putting non-Debian or "Debian adjunct" sources in list.d:

-rw-r--r-- 1 root root 276 Sep 6 10:32 debian-mmedia.list
-rw-r--r-- 1 root root 85 Mar 9 2009 e17.list
-rw-r--r-- 1 root root 134 Apr 25 2009 kernel.list
-rw-r--r-- 1 root root 171 Aug 16 2010 opsview.list

What are the best practices for these directories? Should I bust up my sources.list and put it all in sources.list.d? (this was suggested in another thread on the list, but for me everything is working.) What about apt.conf.d? I figure at some point, they are going to stop supporting the old way, so I figure I should get ahead of the curve on it. It's a little more to manage when it comes to the list files, but I'm running cfengine, so a change to the config file once should work for all. :)

Thanks,
--b

Reply to: