specified repository as a cmdline argument

Panu Matilainen pmatilai at laiskiainen.org
Thu Aug 3 09:12:07 PDT 2006


On Thu, 2006-08-03 at 08:54 -0600, Vincent Danen wrote:
> Is it possible to have apt use a specific repository?  I don't see a way
> to assign a repository name in sources.list, and the thing I'd like to
> do is tell apt to use a specific repostiory when building my ISOs since
> I'm using apt to build the install CD (like a livecd).
> 
> Right now if I want to do that (ie. pass an arch to my build script), I
> have to modify sources.list and I was just wondering if there was an
> easier way.  Essentially, I have my host OS running Annvix 1.2-RELEASE
> (I mostly use urpmi, so I don't even have this source configured for
> apt, so that's ok), but I'd like to be able to specify either the i586
> rep or x86_64 rep to apt without changing my sources.list file at all.
> 
> Is that possible?

There's currently no way to directly enable or disable specific
repositories from the command line (that's in the works though, see the
big "new repository configuration ponderings" thread :)

If the sources.list entries only differ in arch, then all you need to do
make the sources.list entry look something like this:

rpm http://some.server/ path/to/distro/$(ARCH) component1 component2 

The $(ARCH) will be substituted with the value of APT::Architecture
config option which can be controlled from the command line so it'd
basically be:
# apt-get -o apt::architecture=i586 update
# apt-get -o apt::architecture=i586 install something
..and similarly for x86_64.

If you need something more complex, you could use either different
apt.conf for those, or perhaps just different sources.list path, they're
also controllable from the command line, eg
-o Dir::Etc::sourcelist="/my/build/area/sources.list.i586" 
-o Dir::Etc::main="/my/build/area/apt.conf.x86_64"

	- Panu -




More information about the Apt-Rpm mailing list