CreateRepo is a tool that generates the metadata necessary for a package repository on Fedora Core. This repository format is supported by apt, red-carpet(zen), smart, up2date, Yast and yum. A repository can be any of the following:
- A website containing RPMs
- An FTP site containing RPMs
- A directory path (e.g. NFS mounted or local) containing RPMs.
To next we are going to build a professional full repository based on website.
Install PackagesYou must install necessary packages of Extras repository:
Create the directories
== Copy the base RPMs == Copy the RPMs from the DVD to /var/www/html/yum/base. Suposse that you mount you DVD media on /media/cdrecord:<pre> == Create the repository == Create the base repository headers:<pre> Saving Primary metadata Saving file lists metadata Saving other metadata #
This might take some time, depending upon the speed of your processor(s) and HD. On successful conclusion, createrepo should create a directory /repodata. The contents should be: filelists.xml.gz, other.xml.gz, primary.xml.gz, repomd.xml
Copy the Updates
You need select a rsync mirror for updates, a list is at:
these are identified with “rsync.” For example: "rsync://distro.ibiblio.org/fedora-linux-core/". The mirrors share a common structure for updates. Simply append /updates/<version>/<base arch>. Using FC6, this becomes: " rsync://distro.ibiblio.org/fedora-linux-core/updates/6/i386 "Now rsync to create the updates-released repository:
This will create a complete update repository at /var/www/html/yum/updates/i386. The repodata directory will be created with all of the headers.
At this point you can create a cron job for the rsync command, above. Only new updates and headers will be downloaded to your repository.
Create a yum file configEdit and save the /etc/yum.repos.d/myrepo.repo
[updates-released] name=Fedora Core $releasever - $basearch - Released Updates baseurl=http://192.168.0.xx/yum/updates/$basearch/ enabled=1 gpgcheck=1 [base] name=Fedora Core $releasever - $basearch - Base baseurl=http://192.168.0.xx/yum/Fedora/core/$releasever/base/RPMS enabled=1 gpgcheck=1
Substitute the IP address. 192.168.0.xx for the server IP address.
Prepare the RPM config
Fixme: Document this.
Prepare the web server
Yum can use repositories provided to the clients via the web, we will assume that you know apache webserver and need to export the Fedora path above so that it becomes http://192.168.0.xx/fedora on your webserver.To do this, add a section such as:
<Directory "/var/www/fedora"> Options Indexes Includes FollowSymLinks AllowOverride ALL Order allow,deny Allow from all </Directory>to /etc/httpd/conf/httpd.conf in an appropriate place and restart the webserver, and active the runlevel information for httpd services as root:
== Prepare the Repoview == Fixme: Document this. = Client side = <pre> su -c 'rpm -ivh http://192.168.0.xx/myrepo.repo'