# Host your own RPMs with dnf and zypper

> Create a hosted yum repository in CloudRepo, upload your RPMs with curl, and install them with dnf or 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.

> **Early access:** Hosted yum repositories are in early access.

## Create a hosted yum repository

In the [admin portal](https://admin.cloudrepo.io), 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](/docs/authenticate/repository-tokens.html) 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

First make a login file that only you can read:

**Terminal**

```bash
install -m 600 /dev/null ~/.cloudrepo.netrc
```

Save your login in it:

`~/.cloudrepo.netrc`

```ini
machine your-org.mycloudrepo.io login you@example.com password YOUR_REPOSITORY_TOKEN
```

Then upload a package:

**Terminal**

```bash
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

First make the repository file, readable by root alone:

**Terminal**

```bash
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`

```ini
[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**

```bash
sudo dnf install -y acme-agent
```

## Set up zypper

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

**Terminal**

```bash
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`

```ini
username=you@example.com
password=YOUR_REPOSITORY_TOKEN
```

Then add the repository:

**Terminal**

```bash
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**

```bash
sudo zypper -n install acme-agent
```

## 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](https://admin.cloudrepo.io), 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.

---

The page: https://www.cloudrepo.io/docs/consume/yum-hosted.html
