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

3 Mirroring Repositories on the RMT Server

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.

Important
Important: SUSE Linux Enterprise Server 9 Repositories

As SUSE Linux Enterprise Server 9 is no longer supported, RMT does not mirror SUSE Linux Enterprise Server 9 repositories.

3.1 Mirroring Credentials

Before you create a local mirror of the 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 member of multiple organizations, chose the organization you want to work with from the sidebar on the left.

  3. Click Organization in the top menu.

  4. Switch to the Organizational credentials section.

  5. To see the password, click Show password.

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.2.1, “/etc/rmt.conf”.

3.2 Synchronizing Repository Metadata

The local RMT database needs to be updated periodically with the information downloaded from SUSE Customer Center. This includes 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.1.1, “sync.

3.3 Mirroring Packages

Packages for enabled repositories are mirrored on your RMT server. The download of the packages is done periodically but can also be triggered manually.

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.1.5, “mirror.

3.4 Enabling and Disabling Repositories

Repositories can be enabled or disabled by specifically or by stating a product. To enable or disable repositories, you either need the product name 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

To enable or disable all repositories of a product, use the rmt-cli product enable ID and rmt-cli product disable ID commands. To retrieve an ID for a disabled but available product, use the rmt-cli product 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   | Name             | Version | Architecture | Product string       | Release stage | Mirror? | Last mirrored |
+------+------------------+---------+--------------+----------------------+---------------+---------+---------------+
[...]
| 1743 | SUSE Package Hub | 15      | x86_64       | PackageHub/15/x86_64 | released      | false   |               |
[...]
+------+------------------+---------+--------------+----------------------+---------------+---------+---------------+

tux > sudo rmt-cli product enable 1743
2 repo(s) successfully enabled.

tux > sudo rmt-cli product disable 1743
2 repo(s) successfully disabled.

3.4.2 Using Repositories

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

Example:

tux > sudo rmt-cli repo list --all
+--------+-------------------------+-------------------------------------------+------------+---------+---------------+
| SCC ID | Name                    | Description                               | Mandatory? | Mirror? | Last mirrored |
+--------+-------------------------+-------------------------------------------+------------+---------+---------------+
[...]
| 3061   | SUSE-PackageHub-15-Pool | SUSE-PackageHub-15-Pool for sle-15-x86_64 | true       | false   |               |
[...]
+--------+-------------------------+-------------------------------------------+------------+---------+---------------+

tux > sudo rmt-cli repo enable 3061
Repository successfully enabled.

tux > sudo rmt-cli repo disable 3061
Repository successfully disabled.

3.5 Deleting Mirrored Data

After you disable a repository or product as described in Section 3.4, “Enabling and Disabling Repositories”, the mirrored data still remains on your local hard disk. This includes the mirrored RPM packages. To remove the data, manually remove the corresponding directory:

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

3.6 Adding Custom Repositories

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

Custom repositories can be attached to products. This makes allows you to directly connect several repositories 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 attached to. If you need to retrieve the PRODUCT_ID, use the command rmt-cli products list --all.

  4. Enable 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.1.3, “repos.

3.7 Exporting and Importing Repositories

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 transferring 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/sda 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 Repositories”.

Print this page