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 Managing Repositories with YaST SMT Server Management.
The local SMT database needs to be updated periodically with the information downloaded from Micro Focus Customer Center. These periodical updates can be configured with the SMT Management module, as described in 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.
The database installed with SMT contains information about all software repositories available on Micro Focus Customer Center. However, the used mirror credentials determine which repositories can really be mirrored. For more information about getting and setting organization credentials, see Mirroring Credentials.
The mirrorability of repositories is determined by retrieving 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Ā Selecting Repositories to be Mirrored.
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 Listing All Enabled Repositories).
Example 4-1 Listing All Enabled Repositories
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 Listing Accessible Repositories.
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:
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.
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:
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.
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.
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.
Using SMT you can also mirror repositories that are not available at the Micro Focus 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:
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.
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'
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.