User Tools

Site Tools


wiki:linux:yum_mirror_tutorial

How To Create a Yum/Dnf Repository Mirror

Assumptions for this tutorial:

  • You have a server (mirror01) installed with Rocky Linux 9 that you'd like to host your local mirror on.
  • Said server also has a sizeable disk attached to it, mounted at /srv/repos. 2TB should be the minimum disk size.
  • You have at least one system (www01)) that you want to use the mirror.

Step 1: Create the mirror

Use reposync and createrepo to download and create the mirror.

Step 2: Script it!

Put above commands into a shell script so it's easily automatable. Bonus points for adding it to cron!

Step 3: Install Apache

Now that your repos are downloaded and ready to serve, you need a way of serving those packages to your systems. There are several ways around this, but today we're going to go the old-school route by installing the https://www.apache.org to serve HTTP(S) clients.

So get started by installing Apache:

dnf install -y httpd

Step 4: Configure clients

With your shiny new package mirror set up, you need to configure your client systems to use the mirror. Hop on your www01 system and…

wiki/linux/yum_mirror_tutorial.txt · Last modified: 2025/01/07 12:37 by Greg