Creating a Local Fedora 12 Yum Repository

yumfedora Fedora 12 has just been released so it’s time to add it to our arsenal of local yum repositories. We all know the importance of creating a local YUM repository on your LAN. Not only do you decrease the time it takes to download and install updates, you also decrease bandwidth usage.

This How To will show you a simple yet effective way of setting up your local Fedora 12 YUM repository and client.

TIP: Distribute your Fedora YUM configuration via your Puppet Master

Preliminary Note:

I am using two Fedora 12 installations in this tutorial with server1.example.co.za configured with Apache httpd

* server1.example.co.za (IP 10.0.0.100): Fedora 12 YUM Repository and httpd server
* server2.example.co.za (IP 10.0.0.102): Fedora 12 YUM client

Configure Fedora YUM repo and httpd server as follows:

Create the following Directories:

Create a bash script that will rsync your local YUM Repository server with your local YUM mirror (Make sure the mirror supports rsync).

Fedora Mirror list – http://mirrors.fedoraproject.org/publiclist

Add the bash script to your crontab to update your local repository every night (01H00 in this case)

Configure Fedora YUM client servers as follows:

Rename all existing yum repositories from *.repo to *.old

Test your setup by running a yum update on your client machine.

  • Elsucio

    The part of the script does not give me, I put so which part of the mirror, but I get error, I could explain how do you create that line in the script

  • How2CentOS

    @Elsucio – Please send me the error you get so that I am able to assist where possible?

  • Elsucio

    I want you to explain me how you get this line in the script>mirror=mirror.facebook.com::fedora-enchilada/linux
    When i follow the guide of Centos 5.4 repo i dont have problems , but i get a doubt in this line.
    Then i copy and paste the script , run , i get this message>

    Welcome to the Facebook Mirror

    contact: mirror-admin@lists.facebook.com

    receiving file list … rsync: opendir “/linux/releases/12/Fedora/i386/os/EFI/BOOT/.~tmp~” (in fedora-enchilada) failed: Permission denied (13)
    rsync: opendir “/linux/releases/12/Fedora/i386/os/Packages/.~tmp~” (in fedora-enchilada) failed: Permission denied (13)
    rsync: opendir “/linux/releases/12/Fedora/i386/os/images/pxeboot/.~tmp~” (in fedora-enchilada) failed: Permission denied (13)
    rsync: opendir “/linux/releases/12/Fedora/i386/os/images/.~tmp~” (in fedora-enchilada) failed: Permission denied (13)
    rsync: opendir “/linux/releases/12/Fedora/i386/os/isolinux/.~tmp~” (in fedora-enchilada) failed: Permission denied (13)
    rsync: opendir “/linux/releases/12/Fedora/i386/os/repodata/.~tmp~” (in fedora-enchilada) failed: Permission denied (13)
    rsync: opendir “/linux/releases/12/Fedora/i386/os/repoview/layout/.~tmp~” (in fedora-enchilada) failed: Permission denied (13)
    rsync: opendir “/linux/releases/12/Fedora/i386/os/repoview/.~tmp~” (in fedora-enchilada) failed: Permission denied (13)
    rsync: opendir “/linux/releases/12/Fedora/i386/os/.~tmp~” (in fedora-enchilada) failed: Permission denied (13)

    Thanks , and congratulations for this blog

  • How2CentOS

    @Elsucio – I have update the script with a working mirror, please update and try again!

  • elsucio

    Thanks ,now is ok

  • rshendershot

    I couldn't find a simple way to do updates as a parameter so I settled on this.

    verlist=”12″
    archlist=”i386 x86_64″
    #baselist=”updates releases”
    local=/var/www/html/fedora/

    for ver in $verlist
    do
    for arch in $archlist
    do
    #updates/12/i386
    remote=$mirror/updates/$ver/$arch/
    $rsync $remote $local/updates/$ver/$arch/

    #releases/12/Everything/i386/os
    remote=$mirror/releases/$ver/Everything/$arch/os/
    $rsync $remote $local/releases/$ver/Everything/$arch/os/
    done
    done

  • mostafafaridi

    thanks this nice howto
    but I have questions I download all packages it is 18 GB and I download all rpmfusion packages right now and I install Fedora 12 64 bit in home and I do not have internet connection in home so I download all packages in work , so I how I can use this packages in home and install vlc and another package like nvidia driver , I use in work FreeBSD .and download all packages and rpmfusion packages with rsync.

  • How2CentOS

    All you will need to do is copy the folders from your work machine directly to your Fedora machine at home. Make sure you keep the directory structure exactly the same as I mention in this article.

    Then edit your /etc/yum.repos.d/localFedora.repo file as I mentioned above on your home machine and then you'll be able to update your packages via yum.

  • mostafafaridi

    Thanks
    what about rpmfusion package ,
    Do I put all packages and all rpmfusion package in one folder

  • mostafafaridi

    oh my god I forgot important thing , I do not have another computer in home so I can not copy packages in another computer , can I copy all packages in /var/cache/yum and use them ?