Create an RPM repository
Install dependencies
1sudo dnf install -y gnupg createrepo dnf-utils rpm-sign wgetSetup GnuPG
1echo "%echo Generating a PGP key
2Key-Type: RSA
3Key-Length: 4096
4Name-Real: Jeffrey Serio
5Name-Email: hyperreal@moonshadow.dev
6Expire-Date: 0
7%no-ask-passphrase
8%no-protection
9%commit" > ~/hyperreal-pgp-key.batch1gpg --no-tty --batch --gen-key ~/hyperreal-pgp-key.batchExport the public key.
1gpg --armor --export "Jeffrey Serio" > ~/hyperreal-pgp-key.pubExport the private key to back it up somewhere safe.
1gpg --armor --export-secret-keys "Jeffrey Serio" > ~/hyperreal-pgp-key.secAfter backing it up, shred it from the working directory.
1shred -xu ~/hyperreal-pgp.key.secSetup RPM signing
Replace E1933532750E9EEF with your key’s ID.
1echo "%_signature gpg
2%_gpg_name E1933532750E9EEF" > ~/.rpmmacrosCreate a directory to serve the repository.
1mkdir -p ~/rpm-repo/packagesMove RPM packages into the repo directory. Then sign them with the following command:
1rpm --addsign ~/rpm-repo/packages/*.rpmCreate repo index
Once all the packages are signed, create the repository with the following command:
1createrepo ~/rpm-repo/packages/The above command will create a directory in the repo named repodata containing a file named repomd.xml.
Note that the
createrepomust be run against each directory in the repo containing .rpm files.
Now sign the repo metadata with the following command:
1gpg --detach-sign --armor ~/rpm-repo/packages/repodata/repomd.xmlCreate a .repo file
1echo "[hyperreal-kernel-bazzite]
2name=hyperreal kernel bazzite $releasever
3baseurl=https://rpm.hyperreal.coffee/kernel-bazzite/fedora-$releasever/$basearch
4enabled=1
5gpgcheck=1
6gpgkey=https://rpm.hyperreal.coffee/hyperreal-pgp-key.pub" > ~/rpm-repo/hyperreal-kernel-bazzite.repoThe RPM repository should now be ready to be served on a web server with ~/rpm-repo as the web root.
Example Caddy configuration
1rpm.hyperreal.coffee {
2 root * /home/jas/rpm-repos/
3 file_server browse
4}