Try out the new CDN with openSUSE-repos

31. Jul 2023 | Lubos Kocman | CC-BY-SA-3.0

Try out the new CDN with openSUSE-repos

For a while Dirk Mueller was working in the background to get a sponsored CDN subscription. Thanks to his effort Fastly.com has agreed to sponsor the openSUSE project with bandwidth. We primarily intend to use it to improve the reachability (latency) of download.opensuse.org in various areas of the world, but of course can expand it to other usecases as well.

openSUSE-repos simplifies openSUSE repository management by utilizing Repository Index Service (RIS) for core distribution repositories and its latest update switches users to the new cdn.opensuse.org.

Change just landed in Tumbleweed, openSUSE Leap 15.5 users will receive it in the next few days via a maintenance update. The change will be available also as part of Leap Micro 5.5. Users who don’t want to wait can get it from Base:System/openSUSE-repos.

Installation of openSUSE-repos for your distribution

openSUSE-repos backs up and disables all default system repositories as long as they have original filenames. User-defined repositories will remain untouched.

Install the correct package for your distribution and you should be all set.

sudo zypper in openSUSE-repos-Leap

sudo zypper in openSUSE-repos-Tumbleweed

sudo zypper in openSUSE-repos-MicroOS

sudo zypper in openSUSE-repos-LeapMicro

About Repository Index Service

zypp supports RIS services which translate a (remote) repoindex.xml into (local) repository definitions. These definitions are identified by a prefix, in this particular case openSUSE: .

Example: /etc/zypp/repos.d/openSUSE:repo-oss.repo

Making a change like switching users to CDN takes a one-line change in the service template. Service template can reference zypp variables such as a new /etc/zypp/vars.d/DIST_ARCH.

# head /usr/share/zypp/local/service/openSUSE/repo/repoindex.xml
<repoindex ttl="0"
disturl="https://cdn.opensuse.org"
distsub="leap/"
distver="${releasever}"
debugenable="false"
sourceenable="false">

<repo url="%{disturl}/distribution/%{distsub}%{distver}/repo/oss"
alias="repo-oss"
name="%{alias} (%{distver})"
enabled="true"
autorefresh="true"/>

Let’s have a look at our services

# zypper ls # list-services
# | Alias | Name | Enabled | GPG Check | Refresh | Type
--+----------------------------------------+----------------------+---------+-----------+---------+-------
1 | openSUSE | openSUSE | Yes | ---- | Yes | ris
2 | NVIDIA | NVIDIA | Yes | (r ) Yes | Yes | rpm-md
3 | google-chrome | google-chrome | Yes | (r ) Yes | Yes | rpm-md

You may optionally use zypper ref -s to explicitly refresh services. You can manually trigger refresh the service including its repos with zypper refs -r.

If you’d experiment with your own services, /var/log/zypper.log will help you troubleshoot most of the service-related issues. See doc-o-o for more information about zypper and RIS.

Rollback

Users can restore old repository files by following instructions in the project README file.

Share this post: