Creating a Local Mirror
Keeping a local mirror of ClearOS can be useful in some circumstances. This document provides a quick guide on how to implement one.
Local Mirror ClearOS 6.x and 7.x
Find and Allocate Disk Space
You can expect the ClearOS 6.x and 7.x releases to take up about 40-60 GB before the version reaches its end of life. Local mirrors are 'current' mirrors so you won't need to store the whole tree for the entire life of the project. So the first step in creating a local mirror is to find and allocate the necessary disk space on your system. If you are using ClearOS, you can use a Flexshare for this task. In our example, we have created a Flexshare called mirrors and made sure Web access was enabled. On the file system, the mirror directory defaults to /var/flexshares/shares/mirrors.
Download / Synchronize
Now that you have a mirror directory all set up, it's time to start the first synchronize. We will use the ftpsync program to sync our mirrors. You can download the ftpsync program here here:
From an ssh command prompt as root you can perform the following from the directory that you want to install it from (e.g /root/support/extrapackages):
yum -y install wget
Extract the file:
tar xvzof ftpsync.tgz
For ClearOS 6.x, there are two distinct mirrors that need to be kept synchronized:
|clearos||The ClearOS RPMs
|clearcentos||The slimmed down CentOS mirror
To synchronize the ClearOS download servers with the local Flexshare mirror, run:
rsync -rltv --delete --progress sync.clearfoundation.com::clearos /var/flexshare/shares/mirrors/clearos/
rsync -rltv --delete --progress sync.clearfoundation.com::clearcentos /var/flexshare/shares/mirrors/clearcentos/
If you want your internal ClearOS systems to use your new local mirror, change the yum repository entries in /etc/yum.repos.d/base.repo. The excerpt below shows how one of the repository entries (base-os) was changed.
name=ClearOS $releasever - $basearch - OS
name=ClearOS 7.2.0 - 7 - OS
When testing your new repository, you may need to run yum clean all command to make sure you are not using cached data.