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.
Create a hosted yum repository
Section titled “Create a hosted yum repository”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.
Upload an RPM
Section titled “Upload an RPM”First make a login file that only you can read:
install -m 600 /dev/null ~/.cloudrepo.netrcSave your login in it:
machine your-org.mycloudrepo.io login you@example.com password YOUR_REPOSITORY_TOKENThen upload a package:
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.
Set up dnf
Section titled “Set up dnf”First make the repository file, readable by root alone:
sudo install -m 600 /dev/null /etc/yum.repos.d/your-repo.repoThen save these lines in it, as root:
[your-repo]name=your-repobaseurl=https://your-org.mycloudrepo.io/repositories/your-repousername=you@example.compassword=YOUR_REPOSITORY_TOKENenabled=1repo_gpgcheck=1gpgcheck=0gpgkey=https://your-org.mycloudrepo.io/repositories/your-repo/repository.keyrepo_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:
sudo dnf install -y acme-agentSet up zypper
Section titled “Set up zypper”zypper reads the login from a file named for the repository. First make that file, readable by root alone:
sudo install -m 600 /dev/null /etc/zypp/credentials.d/cloudrepo-your-repoSave the login in it, as root:
username=you@example.compassword=YOUR_REPOSITORY_TOKENThen add the repository:
sudo zypper addrepo --refresh 'https://your-org.mycloudrepo.io/repositories/your-repo?credentials=cloudrepo-your-repo' your-reposudo zypper refreshOn 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:
sudo zypper -n install acme-agentRelease a held name
Section titled “Release a held name”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.