Mirroring

YUM repository mirroring

These directions will walk you through using the open source tool reposync to mirror your YUM repository.

  1. Ensure you've installed this repository on your system. reposync will use the YUM configuration in /etc/yum.repos.d/ for mirroring.
  2. Install reposync and createrepo:
    sudo yum install yum-utils createrepo
    NOTE: reposync on CentOS 5 is buggy. We strongly encourage users to consider upgrading their reposync to a newer version.
  3. Create a directory for storing your repository data:
    mkdir -p /path/to/repository
  4. Run reposync specifying the the repository ID and the output directory.
    reposync --repoid=technoweenie_test -p /path/to/repository
  5. Finally, you should use createrepo to regenerate the repository metadata:
    createrepo -o /path/to/repository /path/to/repository
  6. Your YUM repository mirror is ready to use.

Questions? We're here to help! Email support@packagecloud.io

APT repository mirroring

These directions will walk you through using the open source tool apt-mirror to mirror your APT repository.

  1. Install apt-mirror:
    sudo apt-get install apt-mirror
    NOTE: If you are running Debian Wheezy or earlier, you must upgrade to a recent version (0.4.9 or newer) of apt-mirror for HTTPS support.
  2. Create a directory for your mirror:
    mkdir /path/to/repo-mirror
  3. Determine which version of Ubuntu or Debian you'd like to mirror. You'll need to add this to your apt-mirror config in the next step.
  4. Modify the apt-mirror config, using your favorite editor:
    sudo nano /etc/apt/mirror.list
    The default /etc/apt/mirror.list configuration is split into two sections. The top section includes global configuration values. Set base_path to the directory you created above:
    set base_path /path/to/repo-mirror
    set nthreads 5
    set _tilde 0
    The bottom section of /etc/apt/mirror.list contains a list of repositories to mirror. Use the example below, taking care to replace ubuntu and trusty with your Linux distribution and version:
    deb https://packagecloud.io/technoweenie/test/ubuntu/ trusty main
    deb-src https://packagecloud.io/technoweenie/test/ubuntu/ trusty main
  5. Import the GPG key for this repository by following the instructions on the GPG panel.
  6. Run apt-mirror to generate the mirror.
    sudo apt-mirror
  7. Your APT repository mirror is ready to use.

Questions? We're here to help! Email support@packagecloud.io