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

Re: How to forbid apt to use sources.list.d



On Mon, Nov 03, 2014 at 08:23:31PM +0100, Andreas Tille wrote:
> it seems apt-get recently changed its behaviour which affects
> blends-dev.  Blends-dev defines a certain configured sources.list file
> which is set in $aptsources.  Apt is called with the following options:
> 
>    my @aptopts = ("Dir::Etc::sourcelist=$aptsources",
>                    "Dir::State=$aptdir/state",
>                    "Dir::Cache=$aptdir/cache",
>                    "Dir::State::Status=/dev/null",
>                    "Debug::NoLocking=true",
>                    "APT::Get::AllowUnauthenticated=true");
> 
> This worked fine until last week when I generated metapackages
> successfully.  Today I realised that non-free, experimental etc is
> included and realised that this is due to the fact that apt is accessing
> the files I have kept in /etc/apt/sources.list.d on my computer.  After
> renaming this dir blends-dev worked as usual.

No, it didn't stop working recently, it never worked – you just didn't
notice until now. The reason is simply that you are not telling apt to
not use the partial directory, so it does use it… and that hasn't changed
recently (or at all). Have you added preference files recently maybe?
(which is another file/directory you are not overriding)

"apt-config dump" gives you a head start on config knobs to tweak, which
also mentions the one responsible for the sources.list fragments directory:
Dir::Etc::sourceparts.

Apart from what Paul said so that you can actually use an entirely
different config, you have properly better luck with setting Dir
and creating some directories inside it instead of trying to override
every subdirectory with Dir::whatever (while apt supports autocreation
of directories it is using, it doesn't do it if "too much" is missing:
e.g. /var/cache/ isn't created, but apt/archives/partial is).
Oh, and while at it stop using AllowUnauthenticated please.


You can look at test/integration/framework in the apt sources for another
example of how apt and dpkg can be instructed to work inside a temporary
directory (Note that e.g. dpkg does some checks based on the installed
version it can find for itself in the status file, which in turn will
influence the behavior of apt. MultiArch support is a prime example, so
depending on what you are doing, /dev/null might not be enough…).


Best regards

David Kalnischkies

Attachment: signature.asc
Description: Digital signature


Reply to: