This the multi-page printable view of this section.Click here to print.

Return to the regular view of this page.

APT repository mirrors

How to configure a repository mirror for APT

Table of Contents

APT repository mirrors are easy to configure.

Here we will create a repository for the default Debian repository located at http://deb.debian.org/debian

Create blob store

You only need to do this once per group of repositories.

So for Debian then create a blob store called debian, for Ubuntu then create ubuntu etc. Then for each mirror you create then reuse the same blob store for each group.

  1. Log in to Nexus and go to the admin page via the icon in the top nav bar.
  2. Select blob store, then Create blob store
  3. Under Type select File
  4. Under Name enter debian
  5. Select Create blob store to create it.
Blank create blob panel

Create mirror

  1. Log in to Nexus and go to the admin page via the icon in the top nav bar.
  2. Select Repositories then the Create Repository
  3. Select apt (proxy) as the repository type.
  4. Now fill in the required fields.

    Here we will use Debian as an example:

    1. For name enter apt-debian
    2. For Distribution buster - note this isn't as important as you might think but it is required
    3. For Remote storage enter the repository url http://deb.debian.org/debian
    4. For Blob store select the one you created earlier, debian if you are following my naming conventions.
  5. Once it's all filled in select Save and the Repositories list should now show it.
Blank APT config panel

Common repositories to mirror

The following table lists the repositories mirror covering Debian, Ubuntu and Raspberry PI OS:

Distribution Name Remote storage Blob store Distribution
Debian apt-debian http://deb.debian.org/debian debian buster
apt-debian-security http://security.debian.org/debian-security
Raspian /
Raspberry PI OS
apt-raspbian http://raspbian.raspberrypi.org/raspbian/ raspbian buster
apt-raspbian-archive http://archive.raspberrypi.org/debian/
Ubuntu apt-ubuntu-archive http://gb.archive.ubuntu.com/ubuntu ubuntu focal
apt-ubuntu-ports http://ports.ubuntu.com/ubuntu-ports
For ubuntu my apt-ubuntu-archive proxy goes to gb.archive.ubuntu.com as I'm in the UK. If you are using a different endpoint due to being elsewhere in the world you should be using the same one instead of the GB one.

Using the mirror

Once you have configured your repositories, you can then proceed to configure your machines to use them. This is described in the Using Repository mirrors section.