When you mirror a repository, you create a local copy of the entire repository, which includes all its data and structural elements.
To understand the repository mirroring hierarchy in Landscape, you should know the following terms:
- Repository: The repository is the highest level of the hierarchy. It can also be called the "distribution". If you're mirroring an Ubuntu repository, the repository would simply be "Ubuntu".
- Series: Series are inside the repository; they are specific versions of your repository. For example, "Jammy 22.04" could be the series from the Ubuntu repository. When you download a series, you download every package locally that's available from that particular series.
- Pocket: Pockets are inside the series. There are different pockets, or sections, of packages:
- Release pocket: Contains all packages that were available at the moment of releasing that particular series. For example, the Jammy 22.04 release pocket contains all of the packages that were included with Jammy 22.04 at the time of its initial release.
- Updates pocket: Contains all the updates, or newer versions, of the packages in the series that were added to the repository after its initial release. For example, the Jammy 22.04 updates pocket contains all package updates that have been added to Jammy 22.04 after its initial release. If the repository doesn't have any updates, then there won't be an updates pocket.
- Security pocket: This is a subset of the updates pocket, and it contains all the newer versions of packages that were updated specifically to fix a security issue.
- Pull pocket (optional - user-defined): Pull pockets are user-defined pockets that you can create to make specific packages and updates available to different groups of machines. Pull pockets are essentially a "staging" area for you to prepare packages from other pockets before they're distributed to your systems. You can use allowlist and blocklist filters to control which packages are included or excluded from your user-defined pull pocket.
- Component: Components are categories of packages in the system-defined pockets (release, updates, security). There are four possible components:
- Main: Contains all packages that are directly maintained by the repository owner. For an Ubuntu repository, this would be all packages directly maintained by Canonical.
- Restricted: Contains proprietary packages and drivers that aren't fully open-source.
- Universe: Contains packages that are maintained by the community, rather than the owner of the repository (Canonical, for Ubuntu repositories).
- Multiverse: Contains packages that are maintained by the community, but these packages may have restrictions or other reasons to be separate from the universe component.
By default, Ubuntu systems get their updates straight from the internet at archive.ubuntu.com. In an environment with lots of Ubuntu systems (servers and/or desktops) this can cause a lot of internet traffic as each system needs to download the same updates.
Here's a step-by-step guide to mirroring an Ubuntu repository using debmirror
:
- First, install
debmirror
.
sudo apt-get install debmirror
- Decide which repository (e.g. focal, jammy, noble) you want to mirror and the sections you need (e.g., main, restricted, universe, multiverse).
- Below is an example command to mirror the Ubuntu jammy repository for the i386 architecture, including the main, restricted, universe, and multiverse sections.
debmirror \ --nosource -m --passive \ --host=archive.ubuntu.com \ --root=ubuntu/ --method=http --progress \ --dist='jammy','jammy-security','jammy-updates','jammy-backports' \ --section=main,restricted,universe,multiverse \ --arch='i386' ~/UbuntuRepos \ --ignore-release-gpg
Explanation of Options:
--nosource
: Do not download source packages.-m
: Enable verbose output.--passive
: Use passive FTP mode.--host=archive.ubuntu.com
: The remote repository host.--root=ubuntu/
: The root directory of the repository on the remote server.--method=http
: Use HTTP for downloading files.--progress
: Show progress of the download.--dist='jammy','jammy-security','jammy-updates','jammy-backports'
: The distributions (releases) to mirror.--section=main,restricted,universe,multiverse
: The sections of the repository to mirror.--arch='i386'
: The architecture to mirror.- ~/UbuntuRepos: Local directory to store the mirrored repository.
--ignore-release-gpg
: Ignore GPG errors related to the Release file.