Skip to content

Host your own RPMs with dnf and zypper

A hosted yum repository holds the RPMs your team builds. You upload each package with curl, and dnf (Rocky, RHEL, Fedora) and zypper (SUSE, openSUSE) install it. Your organization’s key signs the repository’s index.

In the admin portal, create a repository with yum as the Format and Hosted as the Kind.

You also need a repository token that can write to it. Repository Tokens shows how to make one. Every login below uses the email address of the account that made the token, and the token as the password.

Used on this page only, never saved. Never enter a token or password here.

First make a login file that only you can read:

Terminal
install -m 600 /dev/null ~/.cloudrepo.netrc

Save your login in it:

~/.cloudrepo.netrc
machine your-org.mycloudrepo.io login you@example.com password YOUR_REPOSITORY_TOKEN

Then upload a package:

Terminal
curl --netrc-file ~/.cloudrepo.netrc --fail -T acme-agent-1.4.2-1.x86_64.rpm https://your-org.mycloudrepo.io/repositories/your-repo/

CloudRepo files the package by its own name, version and architecture, whatever the file is called. dnf and zypper usually see the new package in the index within seconds. A package can be up to 2 GiB.

First make the repository file, readable by root alone:

Terminal
sudo install -m 600 /dev/null /etc/yum.repos.d/your-repo.repo

Then save these lines in it, as root:

/etc/yum.repos.d/your-repo.repo
[your-repo]
name=your-repo
baseurl=https://your-org.mycloudrepo.io/repositories/your-repo
username=you@example.com
password=YOUR_REPOSITORY_TOKEN
enabled=1
repo_gpgcheck=1
gpgcheck=0
gpgkey=https://your-org.mycloudrepo.io/repositories/your-repo/repository.key

repo_gpgcheck=1 checks the signed index, and through it every package. CloudRepo signs the index, never your packages: each RPM stays exactly as your build made it. Turn on gpgcheck=1 when you sign your own RPMs.

Now install your package:

Terminal
sudo dnf install -y acme-agent

zypper reads the login from a file named for the repository. First make that file, readable by root alone:

Terminal
sudo install -m 600 /dev/null /etc/zypp/credentials.d/cloudrepo-your-repo

Save the login in it, as root:

/etc/zypp/credentials.d/cloudrepo-your-repo
username=you@example.com
password=YOUR_REPOSITORY_TOKEN

Then add the repository:

Terminal
sudo zypper addrepo --refresh 'https://your-org.mycloudrepo.io/repositories/your-repo?credentials=cloudrepo-your-repo' your-repo
sudo zypper refresh

On its first refresh, zypper shows the key that signs this repository’s index (https://your-org.mycloudrepo.io/repositories/your-repo/repository.key) and asks you to trust it.

Now install your package:

Terminal
sudo zypper -n install acme-agent

A hosted yum repository holds the name of every RPM uploaded to it. To give a name back, open the repository in the admin portal, open More, choose Release a deleted name, type the package name and confirm it is you. A name is released exactly as you type it, case and all.

Anyone with write access to all repositories, owners included, can release a name, and the Audit Log shows who did.

View as Markdown