Changes

Jump to: navigation, search

Signing and Creating a Repository for RPM Packages

234 bytes added, 13:21, 17 July 2017
Creating a Repository-release RPM
[[Category:SBR600]][[Category:DPI908]][[Category:RPM]]
=== Signing RPM packages ===
# Sign those packages with: <code>rpm --addsign <i>packagefile</i></code>
=== Creating a DNF/YUM repository ===
A dnf/yum repository is just a directory of packages and some metadata. The repository client ''dnf'' is similar to the older client ''yum'' (which is still used in some versions of CentOS and older versions of Fedora).
To create a yum repository:
# Create a directory that can be served. The protocol used to serve that directory could be http, ftp, nfs, or something else (the files can be served by putting them on a DVD too!). For http, create the directory within <code>/var/www/html</code>
# Put your signed packages in that directory.
Notice that the repository metadata will be placed in a subdirectory named <code>repodata</code>
=== Testing Creating the Repo and Key Files ===
# Create a new repository file in <code>/etc/yum.repos.d</code> by copying and modifying an existing file in that directory. Keep <code>gpgcheck=1</code> but comment out the <code>gpgkey</code> file.
# Confirm that you cannot install from that repository using dnf or yum, since the gpgkey is unavailable to dnf/yum/rpm.
# Uncomment the <code>gpgkey</code> line, and point it to a new file within <code>/etc/pki/rpm-gpg/</code>
# Create that the ASCII gpg public key file by running (as your regular user): <code>gpg --export --armour <i>e-mail-address</i></code> and saving the output to the new filename (note: you'll need to be your regular user to perform the export, but the root user to install the file).
# Confirm that you can now install from your repository. You should be asked whether you wish to import the key for your repo the first time you use a package from that repo.
# Your GPG key
You can link to this repository-release RPM from a web page, and users can install access to your repository by simply clicking on that link. You can also include this package in a [[:fedora:Spin|Spin]] or [[:fedora:Remix|Remix]]. If you ever need to move your repository's location or make other adjustments, you can provide an updated repository-release package which will be installed when your users perform a <code>yum dnf update</code>.
Take a look at the [http://rpmfusion.org/ RPMFusion] release RPM for an example.

Navigation menu