Tuesday, November 23, 2010

Create Local Fedora 13 Repository

The following outlines the necessary steps to create a local Fedora 13 repository.  I used the following guide http://www.howtoforge.com/automatic-and-up-to-date-fedora-9-installations-with-kickstart-and-novi, which generated a Fedora 9 repository.

In order to serve the local yum repository, http needs to be running and installed.

# yum install httpd
# chkconfig --levels 235 httpd on
# /etc/init.d/httpd start


Next we install the tool createrepo:


# yum install createrepo rpm-devel rpmdevtools expat-devel zlib-devel

The default document root for Apache on Fedora is /var/www/html.
Create directories in the apache root to store the fedora base, updates and patched repo's:


# mkdir -p /var/www/html/fedora/base/13/x86_64
# mkdir -p /var/www/html/fedora/updates/13/x86_64
# mkdir -p /var/www/html/fedora/prepatched/13/x86_64

Assuming you have downloaded the fedora13 .iso image, mount it and copy the dvd contents to the Fedora base directory.

# mount -r -t iso9660 -o loop Fedora-13-x86_64-DVD.iso /media/
# cd /media/
# cp -vfr * /var/www/html/fedora/base/13/x86_64

Get the Fedora 13 updates and store in the updates directory under the web server root.

#  rsync -avrt mirrors.servercentral.net::fedora/updates/13/x86_64/ --exclude=debug/ /var/www/html/fedora/updates/13/x86_64/



Download the Novi source code and compile.  http://downloads.exmachinatech.net/novi/2.1.1/novi-2.1.1-1.fc13.src.rpm

Install the source rpm

# rpm -i novi-2.1.1-1.fc13.src.rpm


This will install the source .spec file in the ~/rpmbuild/SPECS directory.

# rpmbuild --bb ~/rpmbuild/SPECS/novi.spec

# rpm -i ~/rpmbuild/RPMS/x86_64/novi-2.1.1-1.fc13.x86_64.rpm


Copy some files from the base directory to the pre-patched directory.

# cd /var/www/html/fedora/base/13/x86_64
# cp GPL ../../13-prepatched/x86_64/
# cp -fr images/ ../../13-prepatched/x86_64/
# cp media.repo ../../13-prepatched/x86_64/
# cp -fr repodata/ ../../13-prepatched/x86_64/
# cp RPM* ../../13-prepatched/x86_64/
# cp TRANS.TBL ../../13-prepatched/x86_64/
# mkdir ../../13-prepatched/x86_64/Packages

Let's apply updates to base into the pre-patched directory.

# novi -a hardlink -t /var/www/html/fedora/prepatched/13/x86_64/Packages /var/www/html/fedora/base/13/x86_64/Packages /var/www/html/fedora/updates/13/x86_64


Create meta data on the pre-patched directory

# cd /var/www/html/fedora/prepatched/13/x86_64/
# createrepo -g repodata/Fedora-13-comps.xml ${PWD}

# crontab -e

23 4 */2 * * rsync -avrt mirrors.servercentral.net::fedora/updates/13/x86_64/ --exclude=debug/ /var/www/html/fedora/updates/13/x86_64 && /usr/bin/novi -a hardlink -t /var/www/html/fedora/prepatched/13/x86_64/Packages /var/www/html/fedora/base/13/x86_64/Packages /var/www/html/fedora/updates/13/x86_64 && cd /var/www/html/fedora/base/13-prepatched/x86_64 && /usr/bin/createrepo -g repodata/Fedora-13-comps.xml ${PWD}

No comments:

Post a Comment