PDA

View Full Version : Creating A Local Yum Repository (CentOS)


kylehase
13th August 2007, 05:12
The instructions on creating your own Yum Repository (http://www.howtoforge.com/creating_a_local_yum_repository_centos) seem incorrect.

1) The following command downloads the rpms into a new directory named " --exclude=debug"
rsync -avrt rsync://ftp.belnet.be/packages/centos/5.0/updates/i386 \ --exclude=debug/ /var/www/html/centos/updates

2) Various directory locations seem inconsistent. For instance, it says to copy your base rpms to /var/www/centos/base
but the repository configuration file says:
baseurl=http://192.168.*.*/centos/$releasever/os/$basearch/
Which points to a non-existent directory.

Anyone else notice this? Of course I'm replacing the IP with my IP and source repository with a closer mirror.

falko
13th August 2007, 20:54
The instructions on creating your own Yum Repository (http://www.howtoforge.com/creating_a_local_yum_repository_centos) seem incorrect.

1) The following command downloads the rpms into a new directory named " --exclude=debug"


I think this command must either go into two lines:

rsync -avrt rsync://ftp.belnet.be/packages/centos/5.0/updates/i386 \
--exclude=debug/ /var/www/html/centos/updates
Or, if you want to write it in one line, remove the backslash:
rsync -avrt rsync://ftp.belnet.be/packages/centos/5.0/updates/i386 --exclude=debug/ /var/www/html/centos/updates

kylehase
14th August 2007, 00:43
Yes, I realize that and have already finished setting up my repository. The point is that the page is full of errors and such and as such hurts the reputation of Howto forge as a place to get quality tutorials.

To fix this tutorial you could edit each step or fix the yum.conf example. Since that yum.conf uses the standard repository directory structure, I think it best to fix each step to reflect the standard repository directory structure.

mkdir -pv /var/www/html/centos/{base,updates} Should be
mkdir -pv /var/www/html/centos/4/{os,updates}/i386
Replacing 4 and i386 with your major version and architecture.
Additionally you'll need some deeper directories. This is the correct location to copy the CD/DVD rpms.
mkdir -pv /var/www/html/centos/4/os/i386/CentOS/RPMS/

The repodata directory is also incorrect.
createrepo /var/www/html/centos/base Should be
createrepo /var/www/html/centos/4/os/i386/ Otherwise your repodata directory will be in the same directory as your rpms.

As I already pointed out, the rsync command had an unnecessary escape which has now been fixed but also includes incorrect directories that will not work with the yum.conf example given.
rsync -avrt rsync://ftp.belnet.be/packages/centos/5.0/updates/i386 \
--exclude=debug/ /var/www/html/centos/updates Should be
/usr/bin/rsync -avrt rsync://ftp.riken.jp/centos/4/updates/i386 --exclude=debug/ /var/www/html/centos/4/updates/ You can additionally pipe this into mail to receive an email when updates are available.
/usr/bin/rsync -avrt rsync://ftp.riken.jp/centos/4/updates/i386 --exclude=debug /var/www/html/centos/4/updates/ | /bin/mail you@example.com -s "New Repo Updates"
Now the original yum.conf example will work.

falko
14th August 2007, 15:59
You can send the author of the tutorial (thim) a private message, if you like. :)

kylehase
14th August 2007, 16:10
Thanks falko, I sent him a private message.