How to add multiple baseurl entries in repo files

This document (000019926) is provided subject to the disclaimer at the end of this document.

Environment

SUSE Linux Enterprise Server 15 SP2
SUSE Linux Enterprise Server 12 SP5

Situation

Commonly the repository definition files (.repo) in /etc/zypp/repos.d contain one 'baseurl'.
Sometimes, for failover in cases the update server is not available, multiple baseurl entries are helpful.
Zypper/libzypp supports parsing multiple baseurls.

Resolution

The additional url entries can be entered manually in the .repo files.
Per default the .repo files are in /etc/zypp/repos.d/.
An example of such a .repo file is: "SUSE_Linux_Enterprise_Server_12_SP5_x86_64:SLES12-SP5-Pool.repo"
[SUSE_Linux_Enterprise_Server_12_SP5_x86_64:SLES12-SP5-Pool]
name=SLES12-SP5-Pool
enabled=1
autorefresh=0
baseurl=https://a......
type=rpm-md
service=SUSE_Linux_Enterprise_Server_12_SP5_x86_64

Enter the additional baseurl either as:

   baseurl=https://a...
   baseurl=https://b...
or
   baseurl=https://a...
                  https://b...

or a combination of both.

Since SLES15 SP1/2 (libzypp v 17.25.8) it is possible to add the urls in one line separated by blanks, optionally together with a comma ( " " or ", " or " ," or " , ")

   baseurl=https://a... https://b...

ZYPP (zypper) uses the 1st URL. Additional URLs are just used as fallback in case the previous one(s) failed.

After adding the urls, a zypper refresh is recommended

Note:
If the repos are provided by a service, changes (manually or via zypper) may be volatile.
The next service refresh may restore the repos settings.

Disclaimer

This Support Knowledgebase provides a valuable tool for SUSE customers and parties interested in our products and solutions to acquire information, ideas and learn from one another. Materials are provided for informational, personal or non-commercial use within your organization and are presented "AS IS" WITHOUT WARRANTY OF ANY KIND.

  • Document ID:000019926
  • Creation Date: 24-Mar-2021
  • Modified Date:24-Mar-2021
    • SUSE Linux Enterprise Server

< Back to Support Search

For questions or concerns with the SUSE Knowledgebase please contact: tidfeedback@suse.com

SUSE Support Forums

Get your questions answered by experienced Sys Ops or interact with other SUSE community experts.

Join Our Community

Support Resources

Learn how to get the most from the technical support you receive with your SUSE Subscription, Premium Support, Academic Program, or Partner Program.


SUSE Customer Support Quick Reference Guide SUSE Technical Support Handbook Update Advisories
Support FAQ

Open an Incident

Open an incident with SUSE Technical Support, manage your subscriptions, download patches, or manage user access.

Go to Customer Center