3.2 Managing Software Repositories with SMT Command Line Tools

This section describes tools and procedures for viewing information about software repositories available through SMT, configuring these repositories and setting up custom repositories on the command line. For details on the YaST SMT Server Management module, see Section 4.0, Managing Repositories with YaST SMT Server Management.

3.2.1 Updating the local SMT database

The local SMT database needs to be updated periodically with the information downloaded from Novell Customer Center. These periodical updates can be configured with the SMT Management module, as described in Section 2.5, Setting the SMT Job Schedule with YaST.

To update the SMT database manually, use the smt-sync command. For more information about the smt-sync command, see smt-sync.

3.2.2 Enabled Repositories and Repositories that Can Be Mirrored

The database installed with SMT contains information about all software repositories available on Novell Customer Center. However, the used mirror credentials determine which repositories can really be mirrored. For more information about getting and setting organization credentials, see Section 3.1, Mirroring Credentials.

The mirrorability of repositories is determined by retrieving https://nu.novell.com/repo/repoindex.xml using the provided organization credentials. Repositories that can be mirrored have the MIRRORABLE flag set in the repositories table in the SMT database.

The fact that a repository can be mirrored does not mean that it has to be mirrored. Only repositories with the DOMIRROR flag set in the SMT database will be mirrored. For more information about setting up, which repositories should be mirrored, seeĀ Section 3.2.4, Selecting Repositories to be Mirrored.

3.2.3 Getting Information About Repositories

Use the smt-repos command to list available software repositories and additional information. Using this command without any options lists all available repositories, including repositories that cannot be mirrored. In the first column, the enabled repositories (repositories set to be mirrored) are marked with Yes. Disabled repositories are marked with No. The other columns show ID, type, name, target, and description of the listed repositories. The last columns show whether the repository can be mirrored and staging is enabled.

Use the --verbose option, to get additional information about the URL of the repository and the path it will be mirrored to.

The repository listing can be limited to only repositories that can be mirrored or to enabled repositories. To list only repositories that can be mirrored, use the -m or --only-mirrorable option: smt-repos -m.

To list only enabled repositories, use the -o or --only-enabled option: smt-repos -o (see Example 3-1).

Example 3-1 Listing All Enabled Repositories

tux:~ # smt-repos -o
.---------------------------------------------------------------------------------------------------------------------.
| Mirr| ID | Type | Name                    | Target        | Description                             | Can be M| Stag|
+-----+----+------+-------------------------+---------------+-----------------------------------------+---------+-----+
| Yes |  1 | zypp | ATI-Driver-SLE11-SP2    | --            | ATI-Driver-SLE11-SP2                    | Yes     | Yes |
| Yes |  2 | zypp | nVidia-Driver-SLE11-SP2 | --            | nVidia-Driver-SLE11-SP2                 | Yes     | No  |
| Yes |  3 | nu   | SLED11-SP2-Updates      | sle-11-x86_64 | SLED11-SP2-Updates for sle-11-x86_64    | Yes     | No  |
| Yes |  4 | nu   | SLES11-SP1-Updates      | sle-11-x86_64 | SLES11-SP1-Updates for sle-11-x86_64    | Yes     | Yes |
| Yes |  5 | nu   | SLES11-SP2-Core         | sle-11-x86_64 | SLES11-SP2-Core for sle-11-x86_64       | Yes     | No  |
| Yes |  6 | nu   | SLES11-SP2-Updates      | sle-11-i586   | SLES11-SP2-Updates for sle-11-i586      | Yes     | No  |
| Yes |  7 | nu   | WebYaST-Testing-Updates | sle-11-i586   | WebYaST-Testing-Updates for sle-11-i586 | Yes     | No  |
'-----+----+------+-------------------------+---------------+-----------------------------------------+---------+-----'

You can also list only repositories with a particular name or show information about a repository with a particular name and target. To list repositories with a particular name, use the smt-repos repository_name command. To show information about a repository with a particular name and target, use the smt-repos repository_name target command.

To get a list of installation repositories from remote, see Section 8.6, Listing Accessible Repositories.

3.2.4 Selecting Repositories to be Mirrored

Only enabled repositories can be mirrored. In the database, the enabled repositories have the DOMIRROR flag set. Repositories can be enabled or disabled using the smt-repos command.

To enable one or more repositories, follow these steps:

  1. If you want to enable all repositories that can be mirrored or just choose one repository from the list of all repositories, run the smt-repos -e command.

    You are able to limit the list of repositories by using the relevant options. To limit the list to only repositories that can be mirrored, use the -m option: smt-repos -m -e. To limit the list to only repositories with a particular name, use the smt-repos -e repository_name command. To list only a repository with a particular name and target, use the command smt-repos -e repository_name target.

    If you want to enable all repositories belonging to a certain product, use the --enable-by-prod or -p option followed by the name of the product and, optionally, its version, architecture, and release:

    smt-repos -p product[,version[,architecture[,release]]]

    For example, to enable all repositories belonging to SUSE Linux Enterprise Server 10 SP4 for PowerPC architecture, use the following command:

    smt-repos -p SUSE-Linux-Enterprise-Server-SP4,10,ppc

    The list of known products can be obtained with the smt-list-products command.

  2. If more than one repository is listed, choose the one you want to enable by specifying its ID listed in the repository table and pressing Enter. If you want to enable all the listed repositories, use a and press Enter.

To disable one or more repositories, follow these steps:

  1. If you want to disable all enabled repositories or just choose one repository from the list of all repositories, run the smt-repos -d command.

    If you want to choose the repository to be disabled from a shorter list, or if you want to disable all repositories from a limited group, you can use any of the available options to limit the list of the repositories. To limit the list to only enabled repositories, use the -o option: smt-repos -o -d. To limit the list to only repositories with a particular name, use the smt-repos -d repository_name command. To list only a repository with a particular name and target, use the smt-repos -d repository_name target command.

  2. If more than one repository is listed, choose which one you want to disable by specifying its ID listed in the repository table shown and pressing Enter. If you want to disable all the listed repositories, use a and press Enter.

3.2.5 Deleting Mirrored Repositories

You can delete mirrored repositories that are no longer used. If you delete a repository, it will be physically removed from the SMT storage area.

To delete a repository with a particular name, use the smt-repos --delete command. To delete the repository in a namespace, specify the --namespace dirname option.

--delete lists all repositories, and by entering the ID number or by entering the name and target you can delete the specified repositories. If you want to delete all repositories, enter a.

NOTE: Detecting Repository IDs

Every repository has a sha1sum that you can use as an ID. You can get the repository's sha1sum by calling smt-repos -v.

3.2.6 Mirroring Custom Repositories

Using SMT you can also mirror repositories that are not available at the Novell Customer Center. Those repositories are called custom repositories. Use the smt-setup-custom-repos command for this purpose. Custom repositories can also be deleted.

When adding a new custom repository, smt-setup-custom-repos adds a new record in the database, and sets the mirror flag to true by default. If needed, you can disable mirroring later.

To set up a custom repository to be available through SMT, follow these steps:

  1. If you do not know the ID of the product the new repositories should belong to, use smt-list-products to get the ID. For the description of the smt-list-products, see smt-list-products.

  2. Run

    smt-setup-custom-repos --productid product_id \
    --name repository_name --exturl repository_url
         

    In this command product_id is the ID of the product the repository belongs to, repository_name represents the name of the repository and repository_url is the URL the repository is available at. In case the added repository needs to be available for more than one product, specify the IDs of all products that should use the added repository.

    For example, to set My repository available at http://example.com/My_repository to the products with the IDs 423, 424, and 425, use the following command:

    smt-setup-custom-repositories --productid 423 --productid 424 \
    --productid 425 --name 'My_repository' \
    --exturl 'http://example.com/My_repository'

NOTE: Mirroring Unsigned Repositories

In its default configuration, SUSE Linux Enterprise 10 does not allow the use of unsigned repositories. Therefore, if you want to mirror unsigned repositories and use them on client machines, you have to allow this explicitly by executing the following command on the client machines:

rug set security-level checksum
  

To remove an already-set custom repository from the SMT database, use smt-setup-custom-repositories --delete ID, where ID represents the ID of the repository to be removed.

3.2.7 Mirroring SUSE Linux Enterprise Server 9 Repositories

For mirroring old style update repositories which were used for SUSE Linux Enterprise Server 9 and similar products, use a special command: smt-mirror-sle9. This command mirrors from the https://you.novell.com server. The download URL for SUSE Linux Enterprise Server 9 clients is following:

http(s)://example.com/repo/YOU9/<architecture>/update/<product>/<version>/

The smt-mirror-sle9 command does not store information about repositories to be mirrored in the SMT database. It only uses the configuration from the /etc/smt.conf file. The configuration of smt-mirror-sle9 is described in smt-mirror-sle9 Sections of /etc/smt.conf.

The smt-mirror-sle9 command uses wget to mirror repositories. Therefore, you can exclude anything you do not want to be mirrored by adding the exclude_directories option to the /var/lib/smt/.wgetrc configuration file. For more information about wget and /var/lib/smt/.wgetrc, see man wget.