[Yum] set priority for yum repository

Muayyad AlSadi alsadi at gmail.com
Thu Jul 17 16:26:00 UTC 2008


> We want "yum install" to check the local repository before checking other mirror repositories. Is this possible?
yes, just give it a smaller cost in the .repo file

cost=400

for example
[local-fedora-cache]
name=cache for fedora- i386
failovermethod=priority
baseurl=file:///opt/cache/fedora/packages/
enabled=1
gpgcheck=0
cost=400


On Thu, Jul 17, 2008 at 7:14 PM, seth vidal <skvidal at fedoraproject.org> wrote:
> On Thu, 2008-07-17 at 11:12 -0400, Phil Li wrote:
>> Hello,
>>
>> We want "yum install" to check the local repository before checking
>> other mirror repositories. Is this possible?
>>
>> The man page of yum.conf says "If you list more than one baseurl=
>> statement in a repository you will  find  yum  will  ignore  the
>> earlier ones and probably act
>> bizarrely. Don't do this, you've been warned."
>>
>> We would like to create a local repository, which only contains
>> essential packages. Even without Internet connection, students can
>> practice using yum to install certain packages. However, if the
>> Internet connection is available and the packages are not available
>> locally, yum will search the online repository (e.g.
>> mirrors.kernel.org). Is this possible?
>
>
> you can have multiple urls on a single baseurl= line in a conf file -
> that's just defining different mirrors. However, typically, that means
> you have a local mirror, not a partial copy of some of the data.
>
> If you really want to do that, I'd suggest copying the pkgs you care
> about to local but making sure the metadata is identical to what's on
> the upstream mirror. Then you can specify the additional baseurl and yum
> will move through each of them until it finds a responsive/working
> mirror.
>
> does that help?
> -sv
>
>
> _______________________________________________
> Yum mailing list
> Yum at lists.dulug.duke.edu
> https://lists.dulug.duke.edu/mailman/listinfo/yum
>



More information about the Yum mailing list