NEWS CATEGORIES:



NEWS ARCHIVE >>
SOFTPEDIA REVIEWS >>
MEET THE EDITORS >>
Home / News / Linux / Other Tips, Tricks and Tutorials

Other Tips, Tricks and Tutorials


Creating a Local Update Repository for FC6

How to create a local update repository for FC6 LAN computers.

By Mihai Marinof, Linux Editor

4th of January 2007, 10:16 GMT

Adjust text size:


Because Fedora Core is an RPM based Linux distribution, it's quite easy to keep it up to date. Fedora can easily be updated through yum, an update tool which fetches the latest RPM packages from a mirror and installs them. A mirror is a server that provides a copy of one or more files. Mirroring a site reduces traffic to the original source site and spreads the stress and bandwidth costs across other sites. Running a local mirror however, offers very fast access through the LAN connection to local users. Think about it this way: if you're the network admin of a network composed of Fedora Core systems, those systems will need to be updated at some point. And because they are all using the same distribution, the downloaded update packages will be the same. So basically, the computers in that network will use your precious bandwidth to download the same update files, several times, at rather low speeds. Pointless. A local update mirror will prevent unnecessary bandwidth usage by downloading the packages once and then provide them to the local computers at blazing speeds.

1. Install createrepo and repoview

CODE
yum -y install createrepo repoview

You will also need a working Apache (httpd) and Cron installation on your system.

2. Create the directories

CODE
mkdir -pv /var/www/html/yum/{base,updates}
mkdir
-v /var/www/html/yum/updates/6
mkdir -v /var/www/cache

3. Copy the RPMs from the Fedora Core 6 CDs/DVD to /var/www/html/yum/base

4. Create the base repository headers

CODE
createrepo /var/www/html/yum/base

This command will create a new directory, repodata, within the base directory and will contain the files: filelists.xml.gz, other.xml.gz, primary.xml.gz and repomd.xml. This process will take some time, depending on your CPU and disk speed.

5. Select an rsync updates mirror

- Click HERE and choose the nearest mirror which starts with rsync://.

6. Synchronize the local updates directory with the mirrored one

- Append /updates/6/i386 to the chosen rsync mirror. For example, if you choose:
rsync://sunsite.icm.edu.pl/fedora/linux/core/,
it becomes:
rsync://sunsite.icm.edu.pl/fedora/linux/core/updates/6/i386.

- Synchronize the local directory content with the remote one:

CODE
rsync -avrt rsync://sunsite.icm.edu.pl/fedora/linux/core/updates/6/i386
--exclude=debug/ --exclude=repodata/ --exclude=*debuginfo* --exclude=*i18*
--exclude=*langpack* /var/www/html/yum/updates/6

NOTE: The Romanian rsync address (iasi.roedu) isn't correctly written. The correct rsync address is rsync://ftp.iasi.roedu.net/fedora-core-updates/6/i386.

- Create the repository headers:

CODE
createrepo -q -c /var/www/cache/ /var/www/html/yum/updates/6/i386

- Create the RSS feed:

CODE
repoview -qu http://localhost/yum/updates/6/i386 /var/www/html/yum/updates/6/i386

Replace localhost with your webserver address.

7. Create a daily cron script

- Create a new file

CODE
touch /etc/cron.daily/repository

- Open it using your favorite text editor and add this content, after you've modified it to suit your system:

CODE
#!/bin/bash

rsync -avrt rsync://sunsite.icm.edu.pl/fedora/linux/core/updates/6/i386
--exclude=debug/ --exclude=repodata/ --exclude=*debuginfo* --exclude=*i18*
--exclude=*langpack* /var/www/html/yum/updates/6

createrepo -q -c /var/www/cache/ /var/www/html/yum/updates/6/i386

repoview -qu http://localhost/yum/updates/6/i386 /var/www/html/yum/updates/6/i386

exit 0

At this point, only new updates and headers will be downloaded to your repository, once a day.

8. Edit yum configuration file

- You will now have to edit the /etc/yum.conf file on every local network machine that will use the new repository. Add the following content to the end of the yum.conf file:

CODE
[updates-released]
name=Fedora Core $releasever - $basearch - Released Updates
#mirrorlist=http://fedora.redhat.com/download/mirrors/updates-released-fc$releasever
baseurl=http://192.168.0.xx/yum/updates/$releasever/$basearch/
enabled=1
gpgcheck=0

[base]
name=Fedora Core $releasever - $basearch - Base
baseurl=http://192.168.0.xx/yum/base/RPMS
#mirrorlist=http://fedora.redhat.com/download/mirrors/fedora-core-$releasever
enabled=1
gpgcheck=0

NOTE: You will have to replace the 192.168.0.xx address with the correct server's LAN address. Moreover, on the machine holding the repository, replace that address with localhost.

- Now edit the /etc/yum.repos.d/fedora-updates.repo file on each machine and disable the updates section. To do this, look for the line enabled=1 under the [updates] section and replace it with enabled=0.

If everything worked out well, you should be able to run yum update from any of the local computers and it will use the local repository as the update mirror.
Read by 17,553 user(s) | Add comment | Link to this article TWEET THIS


Article rating:
Good (3.9/5) 10 vote(s)    

Subscribe to news | Print article | Send to friend

© Copyright 2001-2009 Softpedia
Contact:

 

 

SEARCH THE NEWS ARCHIVE :




Today's News
| Yesterday's News | News Archive


MORE RELATED ARTICLES:


Local DNS Cache for Faster Browsing

Wolfenstein: Enemy Territory Server Setup

How to Bind a Range of IPs

Screencast Guide: Capure Your Linux Desktop on Video!

How to Setup an Encrypted Filesystem

Grant Root Privileges to Regular Users

Setting Up a SHOUTcast Server + DSP Plug-In

Resetting a Forgotten Root Password

User opinions:


Comment #1 by: Anoop on 12 Feb 2008, 07:56 GMT reply to this comment

good article to understand step by step configuration of yum repository on fc 6

Share your opinion:

Your Name:
Your Email Address:
(will not be used for commercial purposes)
Solve this to prove you're not a bot: =
Your review/opinion:

 




Windows tabGames tabDrivers tabMac tabLinux tabScripts tabMobile tabHandheld tabGadgets tabNews tab

SUBMIT PROGRAM   |   ADVERTISE   |   GET HELP   |   SEND US FEEDBACK   |   RSS FEEDS   |   ENTER NEWS SITE   |   ENGLISH BOARD   |   ROMANIAN FORUM