Skip to content
Branch: master
Find file Copy path
Find file Copy path
Fetching contributors…
Cannot retrieve contributors at this time
97 lines (66 sloc) 3.73 KB



Execute the subsequent commands within the aptly container on the mirror system.

$ docker exec -it aptly_aptly_1 bash

Import GPG keys

# wget -O - | gpg --no-default-keyring --keyring trustedkeys.gpg --import

Add repositories

# aptly mirror create -architectures=amd64 bionic-docker bionic stable
# aptly mirror create -architectures=amd64 bionic bionic main restricted universe multiverse
# aptly mirror create -architectures=amd64 bionic-backports bionic-backports main restricted universe multiverse
# aptly mirror create -architectures=amd64 bionic-security bionic-security main restricted universe multiverse
# aptly mirror create -architectures=amd64 bionic-updates bionic-updates main restricted universe multiverse
# aptly mirror list
List of mirrors:
 * [bionic-docker]: bionic
 * [bionic-backports]: bionic-backports
 * [bionic-security]: bionic-security
 * [bionic-updates]: bionic-updates
 * [bionic]: bionic

To get more information about mirror, run `aptly mirror show <name>`.

Update repositories

# aptly mirror update -force=true -skip-existing-packages -max-tries=3 bionic-docker
# aptly mirror update -force=true -skip-existing-packages -max-tries=3 bionic-backports
# aptly mirror update -force=true -skip-existing-packages -max-tries=3 bionic-security
# aptly mirror update -force=true -skip-existing-packages -max-tries=3 bionic-updates
# aptly mirror update -force=true -skip-existing-packages -max-tries=3 bionic

Create snapshots

# aptly snapshot create bionic-docker-YYYYMMDD from mirror bionic-docker
# aptly snapshot create bionic-backports-YYYYMMDD from mirror bionic-backports
# aptly snapshot create bionic-security-YYYYMMDD from mirror bionic-security
# aptly snapshot create bionic-updates-YYYYMMDD from mirror bionic-updates
# aptly snapshot create bionic-YYYYMMDD from mirror bionic

Publish snapshots

# aptly publish snapshot -distribution bionic-docker bionic-docker-YYYYMMDD ubuntu
# aptly publish snapshot -distribution bionic-backports bionic-backports-YYYYMMDD ubuntu
# aptly publish snapshot -distribution bionic-security bionic-security-YYYYMMDD ubuntu
# aptly publish snapshot -distribution bionic-updates bionic-updates-YYYYMMDD ubuntu
# aptly publish snapshot -distribution bionic bionic-YYYYMMDD ubuntu

If this takes too long, you can use the -skip-contents parameter.

Switch snapshots

If you have updated your repository and want to publish a new snapshot, this will result in an error.

'some package' already used by another published repo.

You have to switch the published snapshot instead.

# aptly publish snapshot bionic-docker ubuntu bionic-docker-YYYYMMDD
# aptly publish snapshot bionic-backports ubuntu bionic-backports-YYYYMMDD
# aptly publish snapshot bionic-security ubuntu bionic-security-YYYYMMDD
# aptly publish snapshot bionic-updates ubuntu bionic-updates-YYYYMMDD
# aptly publish snapshot bionic ubuntu bionic-YYYYMMDD

If this takes too long, you can use the -skip-contents parameter.

You can’t perform that action at this time.