doc/install/mirror.md
GitLab and GitLab Runner Linux packages are available at https://packages.gitlab.com. This document explains how to maintain a local mirror of these repositories.
A local mirror of an apt repository can be created using the apt-mirror tool.
Install apt-mirror
sudo apt install apt-mirror
Create a directory for the mirror
sudo mkdir /srv/gitlab-repo-mirror
Add the following lines to the apt-mirror configuration file present at /etc/apt/mirror.list
set base_path /srv/gitlab-repo-mirror
The mirrored content is written under
/srv/gitlab-repo-mirror/mirror/packages.gitlab.com.
Check the upstream example config file for other available settings.
At the end of the configuration file, specify the repositories to mirror in
the apt sources file URL format.
[!note] The repository structure differs between GitLab and GitLab Runner.
GitLab
GitLab uses the same version strings for packages across OS distributions (with different content). That means these packages are considered Duplicate Packages as per Debian Repository Format.
To work around this, each OS distribution (like Debian Trixie or Ubuntu Focal) gets a dedicated repository that hosts only that distribution. This results in URLs having an extra distribution component.
GitLab Runner
GitLab Runner is a statically linked Go binary and uses the same package for different OS distributions. It uses a single apt repository per OS and hosts all distributions of that OS within that repository.
{{< tabs >}}
{{< tab title="GitLab" >}}
deb https://packages.gitlab.com/gitlab/gitlab-ee/debian/trixie trixie main
deb-src https://packages.gitlab.com/gitlab/gitlab-ee/debian/trixie trixie main
{{< /tab >}}
{{< tab title="GitLab Runner" >}}
deb https://packages.gitlab.com/runner/gitlab-runner/debian trixie main
deb-src https://packages.gitlab.com/runner/gitlab-runner/debian trixie main
{{< /tab >}}
{{< /tabs >}}
Start the mirror process
sudo apt-mirror
A local mirror of an rpm repository can be created using reposync (to
download packages) and createrepo (to generate metadata).
[!note]
reposyncexpects the repository you want to mirror to be installed on the system. Follow the installation docs for the repository you want to mirror.To find the repository ID, list available repositories with:
shellyum repolist
Install createrepo and reposync
sudo yum install createrepo yum-utils
Create a directory for the mirror
sudo mkdir /srv/gitlab-repo-mirror
Run reposync. Pass the repository ID and output directory as arguments.
reposync --repoid=gitlab_gitlab-ee --download-path=/srv/gitlab-repo-mirror
Generate metadata for the repository using createrepo
createrepo -o /srv/gitlab-repo-mirror /srv/gitlab-repo-mirror