[Yum] local "base"?
Karsten Jeppesen
karsten at jeppesens.com
Tue May 24 20:30:58 UTC 2005
Morgan Read wrote:
> Hi,
> If I set up a local repo with the FC3 dvd mounted in it, can I then
> use it as my "[base]" "baseurl" (with Internet mirrors or not? Does
> createrepo provide all the xml meta stuff necessary for doing
> groupinstall, etc. straight from the mounted dvd distro?
Yes you can.
I raised this question some time ago because I have *many* machines and
not all the same arch, so it is an issue for me.
What I ended up doing is having local cache repos which caches the most
common files. Works like a charm except for it is what you would call
"an undocumented feature".
In princip yum does not prioritize repos. In praxis it does.
Your cache just has to be mentioned before the master repo.
An example:
---- snippet from my /etc/yum.conf of an x86 machine ---
#To activate - remove the # in front of the following lines
[cache0]
name=cache0
baseurl=http://yum.jeppesens.com/test0/yum/
#To activate - remove the # in front of the following lines
#[cache1]
#name=cache1
#baseurl=http://yum.jeppesens.com/test1/yum/
[base]
name=base
baseurl=http://mirror.hiwaay.net/redhat/fedora/linux/core/3/i386/os/
http://mirror.linux.duke.edu/pub/fedora/linux/core/3/i386/os/
http://mirrors.xmission.com/fedora/core/3/i386/os/
--- end snippet ---
cache0 is near cache for the base repo. It works fine. If the cache file
is ok then it will be used. If the main repo has updated then it will be
used.
Also: I use the following script to create repos. Note that I create
both the old time headers as the new xml structure. Just because I do
have machines that are transitioning from the old to the new structure.
Customers - I can't control them (and I won't) but I can make life a bit
easier for them.
The script works this way:
I just make a directory. Then I cd to it and then I run ../genheaders
This will create an absolutely empty structure.
Then I just fill the rpms directory with whatever I need and then run
the script again...and again...and again. I mean: everytime I change
something of course.
--- genheaders script ---
cat genheaders
#!/bin/bash
home=$(pwd)
rm -rf rpms/repodata rpms/headers rpms/.olddata yum rpms/*.lsm
ln -s rpms yum
for nn in rpms rpms/repodata; do
if [ ! -e $nn ]; then
mkdir $nn
fi
done
if [ ! -e RPMS.yum ]; then
ln -s rpms RPMS.yum
fi
if [ -x /usr/bin/yum-arch ]; then
#yum-arch -vcz .
yum-arch -vz rpms
fi
cd rpms
for nn in *.rpm; do
[ ! -e ${nn}.lsm ] && rpm -q --queryformat %{Description} -p $nn >
${nn}.lsm
done
if [ -x /usr/bin/createrepo ]; then
cd $home
createrepo -v rpms/
fi
cd $home
chown -R yum:yum *
--- end script ---
Karsten
More information about the Yum
mailing list