How to Setup a Network Repository to Install or Update Packages – Part 11

Best Affordable Linux and WordPress Services For Your Business
Outsource Your Linux and WordPress Project and Get it Promptly Completed Remotely and Delivered Online.

If You Appreciate What We Do Here On TecMint, You Should Consider:

  1. Stay Connected to: Twitter | Facebook | Google Plus
  2. Subscribe to our email updates: Sign Up Now
  3. Get your own self-hosted blog with a Free Domain at ($3.45/month).
  4. Become a Supporter - Make a contribution via PayPal
  5. Support us by purchasing our premium books in PDF format.
  6. Support us by taking our online Linux courses

We are thankful for your never ending support.

Gabriel Cánepa

Gabriel Cánepa is a GNU/Linux sysadmin and web developer from Villa Mercedes, San Luis, Argentina. He works for a worldwide leading consumer product company and takes great pleasure in using FOSS tools to increase productivity in all areas of his daily work.

Your name can also be listed here. Got a tip? Submit it here to become an TecMint author.

RedHat RHCE and RHCSA Certification Book
Linux Foundation LFCS and LFCE Certification Preparation Guide

You may also like...

28 Responses

  1. Alexis says:

    Anyone wondering how to quickly undo the renaming of their .repo files (remove the .orig extension) can use this. Always backup your files first.

    for i in $(ls *.orig); do mv -- "$i" "${i%.orig}"; done

    BTW – These tutorials are great. Thanks!

  2. Flip says:

    Since you have this whole setup spread across 2 or 3 different pages, I may have missed it, but I’m pretty sure you left out the part about opening up the ports on the firewall for the web server.

    # firewall-cmd --permanent --add-port=80/tcp
    # firewall-cmd --permanent --add-port=443/tcp
    # firewall-cmd --reload
  3. Doyin says:


    Would you say this process is an alternative to using RedHat Satellite in a RHEL environment? I’d like to save my company a tons of money getting Satellite or all our servers.

    • Ravi Saive says:


      Yes you absolutely correct, just setup one local network yum repository server, and tell all Linux clients to use this local yum repository to install and update packages over local network, this way you can save lots of money + network bandwidth too, and very quickly..

      • Doyin says:

        Thanks Ravi. In order to centrally initiate/manage the yum updates and the repository, would I still need redhat satellite?

        Even though all the servers make use of the local repo, I’ll still need to centrally manage updates. What’s the best way you would advise to achieve this?

  4. R.K. Bahl says:

    Hi Gabriel,

    There is a small issue here – Once we download the entire structure under “OS” , we get the necessary updates which can be fed to all in house servers through FTP/HTTP. But this update will NOT be complete – for example, we will not get the latest kernel, firefox etc. as their updated packages are contained in “updates, centosplus, extras” etc. directories, which will not get downloaded by the described procedure.

    Also, if we include these directories (updates, centosplus, extras etc.) in separate commands using rsync, we will be downloading lot of data which will be irrelevant – for example the “updates” directory contains around 18 files for firefox rpm of different versions and each of 70 MB size ( half of which are 32bit ) – whereas we just need the latest version of the rpm only. How to get “Only” the required rpms of latest versions from these directories ?

  5. Narsaiah says:

    Why RSYNC, we can use reposync command to sync any yum repo..

  6. Alberto Cardenas says:

    when I run rsync (# rsync -avz rsync:// /var/www/html/repos/centos/) on Centos 7.1, I get always this error:

    rsync: failed to connect to ( Connection timed out (110)
    rsync: failed to connect to ( Connection timed out (110)
    rsync error: error in socket IO (code 10) at clientserver.c(122) [Receiver=3.0.9]

    How can I fix this?
    If has something to do with ports

    P.S. I’ve already tried in different repositories

    Many thanks

  7. asbir says:

    Dear Gabriel Cánepa

    I am a System Administrator at a financial institution. We have around 40 servers with RHEL 6.5, 6.2, 5.5, OEL 5.5, Centos 5.7 etc. We don’t have all the servers connected to the public internet. We want to create a local yum repository that is connected with both outside and inside and get all software updates there and use this repo from all other internal servers. The problem is that could I connect all versions specially the 5x to use the central yum repo on RHEL 6.5? There are many mirrors for CentOS as described in this article. Is the same process will work in RHEL and where will I get the RHEL mirrors?
    I am desperately seeking for a solution for a long time. Many of my new projects are pending for this. Please help me in this regard.
    Thanks in advance.

    • @asbir,
      The same process described in this article for CentOS should work for RHEL as well. I am afraid that the information provided in your comment is not enough for me to assess the situation. If you can be more specific, upload a document somewhere with your intended set up and I will take a look.

  8. Carlos Sepulveda says:

    On cron, after running “rsync”, it’s mandatory/recommended to run the “createrepo –update”?


    • @Carlos,
      I must confess I didn’t think of it while writing this article, so thank you for bringing this to my attention. Absolutely – I would recommend using createrepo with the update flag in the scenario that you described.

  9. Please note: Some ISPs knock-out the standard port(s) for rsync.

    This will cause your initial-load and your refreshes to fail.

    • @Pim,
      Thank you for bringing that to our attention. Luckily at least my ISP didn’t do it :). I was able to complete the tutorial without issues or unnecesary delays.
      That being said, it would be a good idea to find out if other ISPs block the ports (or not) in order to know which one we can use.
      Thanks for your comment, again!

  10. Izzeldin Eltayeb Eltahir says:

    Thank for your great coverage of exam objectives , i wish this all 12 parts put on pdf , mobi ,epub format or develop as book ,also the same for LFCS parts ,I really appreciate everything you’ve done.

Got something to say? Join the discussion.

Your email address will not be published. Required fields are marked *

This site uses Akismet to reduce spam. Learn how your comment data is processed.