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.

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 SUSE Linux Enterprise 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. Select Proxies in the top menu.

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

  5. To see the password, select the eye symbol.

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. When repositories are enabled, it's 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 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 Edit source

To enable or disable mirroring of 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 Edit source

After you disable 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 remove the data, manually remove the 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 be attached 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 attached to. If you need to retrieve the PRODUCT_ID, use the command rmt-cli products list --all.

  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 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/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 exported settings can then by imported by the server connected to the SUSE Customer Center (sun). This ensures that sun downloads all data required by sirius.

Print this page