Configure Repository mirror

Configure repository mirrors

Now we have a working installation it's time to set up mirrors for package repositories.

Naming conventions

Although you can call the repositories anything you want, it's advisable to keep to a naming convention. The number of repositories will grow over time, and it will become obvious later which repository is for which package manager.

Because of this I advise the following:

  • Keep repository names lower case and use - as a word separator. Never use a space.
  • The first word in a repository name should be the type,
    e.g. apt for an apt repository, npm for a node/npm repository etc.
  • The second word in a repository name should be the distribution.
    For example, apt-debian for Debian, apt-ubuntu for Ubuntu or apt-raspbian for Raspberry PI OS.
  • Any subsequent words in the name would be for specific repository names.
    e.g. apt-debian-security for the Debian security repository.

Keeping to this scheme will make it easier to maintain as well as keeping like repositories next to each other within the Nexus UI.

Object Stores

Each repository mirror requires an object store to store the cached artefacts. It's advisable to create a new object store for each type of repository.

So for any mirror whose name starts with apt-debian then create a keystore called debian and use it as the backing store for all of them. Do the same for Ubuntu, Raspberry PI OS etc.

If you are mirroring third party repositories like NVidia or OBS then you can either create an object store for each or create one called thirdparty and use that for those smaller repositories. The naming is up to you, but it can help in keeping artefacts separate & not have individual large stores.

Configuring a repository mirror

The following subsections list how to configure each repository type:


APT repository mirrors

How to configure a repository mirror for APT

NPM mirror

How to configure a mirror for NPM

PIP mirror

How to configure a mirror for PIP

Last modified October 30, 2021: Change link titles to simplify them (7db0de7)