Jump to contentJump to page navigation: previous page [access key p]/next page [access key n]
Applies to SUSE Linux Enterprise Server 15 SP1

3 Mirroring Repositories on the RMT Server Edit source

You can mirror the installation and update repositories on the RMT server. This way, you do not need to download updates on each machine, which saves time and bandwidth.

In its default configuration, RMT mirrors enabled product repositories automatically once every night.

By default, the mirrored repositories are stored in /var/lib/rmt/public/repo.

When enabled repositories are fully mirrored, you can register your client systems against RMT by running SUSEConnect --url https://RMT_HOSTNAME on the client machine. After successful registration, the repositories from the RMT server will be used by zypper on the client machine.

Important
Important: SUSE Linux Enterprise Server 11 Clients

RMT does not support clients with SUSE Linux Enterprise Server versions 11 and below.

3.1 Mirroring Credentials Edit source

Before you create a local mirror of the SUSE Linux Enterprise repositories, you need appropriate organization credentials. You can obtain the credentials from SUSE Customer Center.

To get the credentials from SUSE Customer Center, follow these steps:

  1. Visit SUSE Customer Center at http://scc.suse.com and log in.

  2. If you are a member of multiple organizations, select the organization you want to work with from the sidebar on the left.

  3. Select Proxies in the top menu.

  4. The credentials are displayed in the top right corner.

  5. To see the password, click the Eye iconicon.

The obtained credentials should be set with the YaST RMT Server Configuration module or added directly to the /etc/rmt.conf file. For more information about the /etc/rmt.conf file, see Section 5.3.1, “/etc/rmt.conf”.

3.2 Synchronizing Repository Metadata Edit source

The local RMT database needs to be updated periodically with the information downloaded from SUSE Customer Center. This includes information about available products and repositories.

The synchronization is done with the systemd timer rmt-server-sync.timer. To view the status, for example the next running time, use systemctl status:

root # systemctl status rmt-server-sync.timer
● rmt-server-sync.timer - RMT Sync timer
   Loaded: loaded (/usr/lib/systemd/system/rmt-server-sync.timer; enabled; vendor preset: disabled)
   Active: active (waiting) since Fri 2018-06-22 04:22:34 EDT; 2h 34min ago
  Trigger: Sat 2018-06-23 03:53:00 EDT; 20h left

Jun 22 04:22:34 d31 systemd[1]: Started RMT Sync timer.

To update the RMT database manually, use the rmt-cli sync command. For details, see Section 5.1.2, “sync.

3.3 Mirroring Packages Edit source

Packages for enabled repositories are mirrored on your RMT server. Packages are downloaded periodically once a day. But the download can also be triggered manually at any time.

The periodic mirroring is done by the systemd timer rmt-server-mirror.timer. To show the status, for example the next running time, use systemctl status:

root # systemctl status rmt-server-mirror.timer
● rmt-server-mirror.timer - RMT Mirror timer
   Loaded: loaded (/usr/lib/systemd/system/rmt-server-mirror.timer; enabled; vendor preset: disabled)
   Active: active (waiting) since Fri 2018-06-22 04:22:34 EDT; 2h 34min ago
  Trigger: Sat 2018-06-23 02:17:57 EDT; 19h left

Jun 22 04:22:34 d31 systemd[1]: Started RMT Mirror timer.

To update the mirrored packages manually, use the rmt-cli mirror command. For details, see Section 5.1.6, “mirror.

3.4 Enabling and Disabling Mirroring of Repositories Edit source

Mirroring of repositories can be enabled or disabled individually or by stating a product. You can specify one or more repositories or products at once. When repositories are enabled, their packages are downloaded and updated during the mirroring process. To enable or disable mirroring of repositories, you either need the product string or ID, or the repository name or ID. In general, enabling or disabling a product is desired, because this automatically enables or disables all repositories associated with the product.

3.4.1 Using Products Edit source

To enable or disable all repositories of a product, use the rmt-cli products enable ID and rmt-cli product disable ID commands. To retrieve an ID for a disabled but available product, use the rmt-cli products list --all command. To retrieve an ID for an enabled product, use the rmt-cli product list command.

Example:

tux > sudo rmt-cli products list --all
+------+----------------------+---------+--------+--------------+---------------
| ID   | Product              | Version | Arch   | Mirror?      | Last mirrored
+------+----------------------+---------+--------+--------------+---------------
[...]
| 1743 | SUSE Package Hub     | 15      | x86_64 | Don't Mirror |
|      | PackageHub/15/x86_64 |         |        |              |
[...]

tux > sudo rmt-cli products enable 1743
Found product by target 1743: SUSE Package Hub 15 x86_64.
Enabling SUSE Package Hub 15 x86_64:
  SUSE Package Hub 15 x86_64:
    Enabled repository SLE-Module-Packagehub-Subpackages15-Pool.
    Enabled repository SLE-Module-Packagehub-Subpackages15-Updates.
    Enabled repository SUSE-PackageHub-15-Pool.
    Enabled repository SUSE-PackageHub-15-Standard-Pool..

tux > sudo rmt-cli products disable 1743
Found product by target 1743: SUSE Package Hub 15 x86_64.
Disabling SUSE Package Hub 15 x86_64:
  SUSE Package Hub 15 x86_64:
    Disabled repository SLE-Module-Packagehub-Subpackages15-Pool.
    Disabled repository SLE-Module-Packagehub-Subpackages15-Updates.
    Disabled repository SUSE-PackageHub-15-Pool.
    Disabled repository SUSE-PackageHub-15-Standard-Pool.

 To clean up downloaded files, run 'rmt-cli repos clean'
Tip
Tip: Enabling and Disabling Multiple Products at Once

To enable or disable multiple products at once, specify a space delimited list of their IDs or product strings, for example:

tux > sudo rmt-cli products enable 1743 SLES/15/x86_64 SLES/12
Found product by target 1743: SUSE Package Hub 15 x86_64.
Enabling SUSE Package Hub 15 x86_64:
  SUSE Package Hub 15 x86_64:
    Enabled repository SLE-Module-Packagehub-Subpackages15-Pool.
    Enabled repository SLE-Module-Packagehub-Subpackages15-Updates.
    Enabled repository SUSE-PackageHub-15-Pool.
    Enabled repository SUSE-PackageHub-15-Standard-Pool.
Found product by target SLES/15/x86_64: SUSE Linux Enterprise Server 15 x86_64.
Enabling SUSE Linux Enterprise Server 15 x86_64:
  SUSE Linux Enterprise Server 15 x86_64:
    Enabled repository SLE-Product-SLES15-Pool.
    Enabled repository SLE-Product-SLES15-Updates.
    Enabled repository SLE15-Installer-Updates.
  Basesystem Module 15 x86_64:
    Enabled repository SLE-Module-Basesystem15-Pool.
    Enabled repository SLE-Module-Basesystem15-Updates.
  Server Applications Module 15 x86_64:
    Enabled repository SLE-Module-Server-Applications15-Pool.
    Enabled repository SLE-Module-Server-Applications15-Updates.
Found product by target SLES/12: SUSE Linux Enterprise Server 12 x86_64.
Enabling SUSE Linux Enterprise Server 12 x86_64:
  SUSE Linux Enterprise Server 12 x86_64:
    Enabled repository SLES12-Pool.
    Enabled repository SLES12-Updates.

3.4.2 Using Repositories Edit source

To enable or disable mirroring of specific repositories, use the rmt-cli repos enable ID and rmt-cli repos disable ID commands. To retrieve an ID for a disabled but available repository, use the rmt-cli repos list --all command. To retrieve an ID for an enabled repository, use the rmt-cli repos list command.

Example:

tux > sudo rmt-cli repos list --all
+--------+-------------------------+-------------------------------------------+
| ID     | Name                    | Description                               |
+--------+-------------------------+-------------------------------------------+
[...]
| 3061   | SUSE-PackageHub-15-Pool | SUSE-PackageHub-15-Pool for sle-15-x86_64 |
[...]
+--------+-------------------------+-------------------------------------------+

tux > sudo rmt-cli repos enable 3061
Repository by ID 3061 successfully enabled.

tux > sudo rmt-cli repos disable 3061
Repository by ID 3061 successfully disabled.

To clean up downloaded files, please run 'rmt-cli repos clean'
Tip
Tip: Enabling and Disabling Multiple Repositories at Once

To enable or disable multiple repositories at once, specify a space delimited list of their IDs, for example:

tux > sudo rmt-cli repos enable 2526 3263
Repository by ID 2526 successfully enabled.
Repository by ID 3263 successfully enabled.

tux > sudo rmt-cli repos disable 2526 3263
Repository by ID 2526 successfully disabled.
Repository by ID 3263 successfully disabled.

To clean up downloaded files, please run 'rmt-cli repos clean'

3.5 Deleting Mirrored Data Edit source

After you disable the mirroring of a repository or product as described in Section 3.4, “Enabling and Disabling Mirroring of Repositories”, the mirrored data still remains on your local hard disk. This includes the mirrored RPM packages.

To delete disabled repository's data, use the command rmt-cli repos clean. With this command, RMT verifies that only enabled repositories are mirrored and provides a way to delete invalid data.

Before removing any data, the command lists the affected repositories and requires the user to input "yes" to continue.

tux > sudo rmt-cli repos clean
RMT found locally mirrored files from the following repositories which are not marked to be mirrored:

SLE-Product-SLES15-Updates for sle-15-x86_64
SLE-Product-SLES15-Pool for sle-15-x86_64
SLE15-Installer-Updates for sle-15-x86_64

Would you like to continue and remove the locally mirrored files of these repositories?
Only 'yes' will be accepted.

Enter a value:  yes

Deleted locally mirrored files from repository 'SLE-Product-SLES15-Updates for sle-15-x86_64'.
Deleted locally mirrored files from repository 'SLE-Product-SLES15-Pool for sle-15-x86_64'.
Deleted locally mirrored files from repository 'SLE15-Installer-Updates for sle-15-x86_64'.

Clean finished. An estimated 157 MB were removed.
Tip
Tip: Manually Remove Repository Data

To delete disabled repository data, manually remove its corresponding directory:

tux > sudo rm -r /usr/share/rmt/public/repo/SUSE/Products/PRODUCT/VERSION/ARCHITECTURE/

3.6 Adding Custom Repositories Edit source

You can mirror custom repositories with the RMT server. These repositories are not provided by the SUSE Customer Center. Repositories can be provided by, for example, the Open Build Service, third-party vendors, or created with createrepo.

Custom repositories can either be standalone, or you can attach them to products. This allows you to connect multiple repositories with one command on a client registered to the RMT server.

The following example procedure illustrates the mirroring of a third-party repository.

  1. Add the remote repository to the RMT server. Replace URL with the URL to the repository. Replace NAME with a name of your choice for the repository.

    root # rmt-cli repos custom add URL NAME
  2. List all custom repositories to get the ID of the new repository.

    root # rmt-cli repos custom list
  3. Optionally attach the new custom repository to a product. For example, if the new custom repository is required by all desktop clients, it can be attached to the SUSE Linux Enterprise Desktop product.

    root # rmt-cli repos custom attach REPOSITORY_ID PRODUCT_ID

    Replace REPOSITORY_ID with the ID of the new custom repository. Replace PRODUCT_ID with the ID of a product you want the repository to be attached to. If you need to retrieve the PRODUCT_ID, use the command rmt-cli products list --all.

    Important
    Important

    When custom repositories are attached to a product, clients registering to that product will have such repository added in a disabled state. To enable the repository, find its ID with the command zypper lr and run:

    root # zypper mr -e REPO_ID
  4. Enable mirroring of the new custom repository.

    root # rmt-cli repos custom enable REPOSITORY_ID

To get a list of all available custom repositories commands, see Section 5.1.4, “repos.

3.7 Exporting and Importing Repositories Edit source

RMT has built-in functions to import and export data about available repositories and the mirrored packages. For example, this can be used to speed up the setup of a new RMT server by locally copying already mirrored RPM packages.

Another use case is the offline mode. It allows the transfer of data to a disconnected RMT server, for example to provide updates to computers in an air-gapped network.

The following procedure describes the transfer of data and mirrored RPMs between two RMT servers with a USB drive. The server sun is connected to the SUSE Customer Center, while sirius is a server in an air-gapped network.

  1. Log in on the server sun.

    root@sun # rmt-cli sync
    root@sun # rmt-cli mirror
  2. Connect a USB drive, assumed to be /dev/sdb and mount it, for example in /mnt/external.

    root@sun # mount /dev/sdb1 /mnt/external
    1. Export the data about available repositories and products.

      root@sun # rmt-cli export data /mnt/external/
    2. Export the list of enabled repositories. The exported file is required for exporting the repositories in the next step.

      root@sun # rmt-cli export settings /mnt/external/
    3. Export mirrored RPM packages. Depending on the size of mirrored repositories, this can take a long time.

      root@sun # rmt-cli export repos /mnt/external/
  3. Unmount and unplug the disk from sun and go to sirius.

    root@sun # umount /mnt/external
  4. Connect the USB drive to sirius and mount it in /mnt/external.

    root@sirius # mount /dev/sdb1 /mnt/external
    1. Import the meta data about available repositories and products.

      root@sirius # rmt-cli import data /mnt/external/
    2. Import mirrored RPM packages. Depending on the size of mirrored repositories, this can take a long time.

      root@sirius # rmt-cli import repos /mnt/external/
  5. Enable repositories as required on the sirius. For details, see Section 3.4, “Enabling and Disabling Mirroring of Repositories”.

Note
Note: Exporting Enabled Settings from Air-Gapped Server

If your air-gapped server (sirius) has many enabled repositories, or if the enabled repositories change frequently, we recommend to export the repository settings from this server.

The server connected to the SUSE Customer Center (sun) can then import the exported settings. This ensures that sun downloads all data required by sirius.

Print this page