RedHat Repository
Cloudsmith provides public & private repositories for RPM packages (RedHat, Fedora, SUSE)
RedHat is a popular Enterprise focused flavor of Linux.
RedHat Package Manager (RPM) is a free and open source packaging format.
For more information on RedHat, please see:
- RedHat: The official website for RedHat
- RPM: The official website for RedHat Package Manager
- RPM Documentation: The official docs for RPM
In the following examples:
Identifier | Description |
---|---|
OWNER | Your Cloudsmith account name or organization name (namespace) |
REPOSITORY | Your Cloudsmith Repository name (also called "slug") |
DISTRO | Your distribution (i.e el, fedora or opensuse). You can also use "any-distro" if your package is compatible with more than one distribution |
VERSION | Your version name (i.e 7, 29). You can also use "any-version" if your package is compatible with more than one version |
FINGERPRINT | The 8 Byte fingerprint of the Public GPG key for the repository |
TOKEN | Your Cloudsmith Entitlement Token (see Entitlements for more details) |
USERNAME | Your Cloudsmith username |
PASSWORD | Your Cloudsmith password |
API-KEY | Your Cloudsmith API Key |
PACKAGE_NAME | The name of your package |
PACKAGE_VERSION | The version number of your package |
PACKAGE_ARCH | The architecture of your package (i.e x86_64) |
Upload a Package
To upload, you will need to generate your package first. We highly recommend fpm for simplifying this.
With fpm, you can build a package from a directory that represents the layout on the target system installation using:
fpm -f -s dir -t rpm -n PACKAGE_NAME -v PACKAGE_VERSION`
This generates a RedHat package file (.rpm
) like your-package-1.2.3.rpm
that you can upload.
You can also build a package from a tarball (
.tgz
) or even Python, Ruby or npm packages. In addition to that, you can provide additional information during the packaging, such as other metadata like packaging dependencies, authorship, etc. Please refer to the official fpm documentation for more information.
Upload via the Cloudsmith CLI
For full details of how to install and setup the Cloudsmith CLI, see Command Line Interface.
The command to upload a RedHat package via the Cloudsmith CLI is:
cloudsmith push rpm OWNER/REPOSITORY/DISTRO/VERSION PACKAGE_NAME-PACKAGE_VERSION.PACKAGE_ARCH.rpm
Example: Upload a package for RedHat 5
cloudsmith push rpm org/repo/el/5 libxml2-2.9.4-2.el5.x86_64.rpm
Example: Upload a package for any RedHat version
cloudsmith push rpm org/repo/el/any-version libxml2-2.9.4-2.x86_64.rpm
Example: Upload a package for any version of any distribution
cloudsmith push rpm org/repo/any-distro/any-version libxml2-2.9.4-2.x86_64.rpm
Upload via Cloudsmith Website
Please see Upload a Package for details of how to upload via the Website UI.
Download/ Install a Package
Setup
You have a choice of 3 methods to setup your Cloudsmith repository:
- Automatic configuration (recommended)
- Force a specific distribution/release (if your system is compatible but not identical)
- Manual configuration
Public Repositories
To install RPM packages from a public Cloudsmith repository, you can quickly set up the repository automatically:
Yum (RedHat, CentOS, Amazon), Dnf (Fedora) or Zypper (Suse)
curl -1sLf \
'https://dl.cloudsmith.io/public/OWNER/REPOSITORY/cfg/setup/bash.rpm.sh' \
| sudo bash
Alternatively, if you need to force a specific distribution:
curl -1sLf \
'https://dl.cloudsmith.io/public/OWNER/REPOSITORY/cfg/setup/bash.rpm.sh' \
| sudo distro=DISTRO codename=VERSION bash
Or, you can manually configure the repository:
Yum (RedHat, CentOS, Amazon)
yum install yum-utils pygpgme
rpm --import 'https://dl.cloudsmith.io/public/OWNER/REPOSITORY/cfg/gpg/gpg.FINGERPRINT.key'
curl -1sLf 'https://dl.cloudsmith.io/public/OWNER/REPOSITORY/cfg/setup/config.rpm.txt?distro=DISTRO&codename=CODENAME' > /tmp/OWNER-REPOSITORY.repo
yum-config-manager --add-repo '/tmp/OWNER-REPOSITORY.repo'
yum -q makecache -y --disablerepo='*' --enablerepo='OWNER-REPOSITORY'
Dnf (Fedora)
dnf install yum-utils pygpgme
rpm --import 'https://dl.cloudsmith.io/public/OWNER/REPOSITORY/cfg/gpg/gpg.FINGERPRINT.key'
curl -1sLf 'https://dl.cloudsmith.io/public/OWNER/REPOSITORY/cfg/setup/config.rpm.txt?distro=DISTRO&codename=CODENAME' > /tmp/OWNER-REPOSITORY.repo
dnf config-manager --add-repo '/tmp/OWNER-REPOSITORY.repo'
dnf -q makecache -y --disablerepo='*' --enablerepo='OWNER-REPOSITORY' --enablerepo='OWNER-REPOSITORY-source'
Zypper (Suse)
curl -1sLf 'https://dl.cloudsmith.io/public/OWNER/REPOSITORY/cfg/setup/config.rpm.txt?distro=DISTRO&codename=CODENAME' > /tmp/OWNER-REPOSITORY.repo
zypper ar -f '/tmp/OWNER-REPOSITORY.repo'
zypper --gpg-auto-import-keys refresh OWNER-REPOSITORY OWNER-REPOSITORY-source
Private Repositories
Private Cloudsmith repositories require authentication. You can choose between two types of authentication, Entitlement Token Authentication or HTTP Basic Authentication.
The setup method will differ depending on what authentication type you choose to use.
Entitlement Tokens, User Credentials and API-Keys should be treated as secrets, and you should ensure that you do not commit them in configurations files along with source code or expose them in any logs.
To install RPM packages from a private Cloudsmith repository, you can quickly set up the repository automatically:
Yum (RedHat, CentOS, Amazon), Dnf (Fedora) or Zypper (Suse)
curl -1sLf \
'https://dl.cloudsmith.io/TOKEN/OWNER/REPOSITORY/cfg/setup/bash.rpm.sh' \
| sudo bash
curl -u "USERNAME:PASSWORD" -1sLf \
'https://dl.cloudsmith.io/basic/OWNER/REPOSITORY/cfg/setup/bash.rpm.sh' \
| sudo bash
curl -u "USERNAME:API-KEY" -1sLf \
'https://dl.cloudsmith.io/basic/OWNER/REPOSITORY/cfg/setup/bash.rpm.sh' \
| sudo bash
curl -u "token:TOKEN" -1sLf \
'https://dl.cloudsmith.io/basic/OWNER/REPOSITORY/cfg/setup/bash.rpm.sh' \
| sudo bash
Alternatively, if you need to force a specific distribution:
curl -1sLf \
'https://dl.cloudsmith.io/TOKEN/OWNER/REPOSITORY/cfg/setup/bash.rpm.sh' \
| sudo distro=DISTRO codename=VERSION bash
curl -u "USERNAME:PASSWORD" -1sLf \
'https://dl.cloudsmith.io/basic/OWNER/REPOSITORY/cfg/setup/bash.rpm.sh' \
| sudo distro=DISTRO codename=VERSION bash
curl -u "USERNAME:API-KEY" -1sLf \
'https://dl.cloudsmith.io/basic/OWNER/REPOSITORY/cfg/setup/bash.rpm.sh' \
| sudo distro=DISTRO codename=VERSION bash
curl -u "token:TOKEN" -1sLf \
'https://dl.cloudsmith.io/basic/OWNER/REPOSITORY/cfg/setup/bash.rpm.sh' \
| sudo distro=DISTRO codename=VERSION bash
Or, you can manually configure the repository:
Yum (RedHat, CentOS, Amazon)
yum install yum-utils pygpgme
rpm --import 'https://dl.cloudsmith.io/TOKEN/OWNER/REPOSITORY/cfg/gpg/gpg.FINGERPRINT.key'
curl -1sLf 'https://dl.cloudsmith.io/TOKEN/OWNER/REPOSITORY/cfg/setup/config.rpm.txt?distro=DISTRO&codename=VERSION' > /tmp/OWNER-REPOSITORY.repo
yum-config-manager --add-repo '/tmp/OWNER-REPOSITORY.repo'
yum -q makecache -y --disablerepo='*' --enablerepo='OWNER-REPOSITORY'
yum install yum-utils pygpgme
rpm --import 'https://dl.cloudsmith.io/basic/OWNER/REPOSITORY/cfg/gpg/gpg.FINGERPRINT.key'
curl -u "USERNAME:PASSWORD" -1sLf 'https://dl.cloudsmith.io/basic/OWNER/REPOSITORY/cfg/setup/config.rpm.txt?distro=DISTRO&codename=VERSION' > /tmp/OWNER-REPOSITORY.repo
yum-config-manager --add-repo '/tmp/OWNER-REPOSITORY.repo'
yum -q makecache -y --disablerepo='*' --enablerepo='OWNER-REPOSITORY'
yum install yum-utils pygpgme
rpm --import 'https://dl.cloudsmith.io/basic/OWNER/REPOSITORY/cfg/gpg/gpg.FINGERPRINT.key'
curl -u "USERNAME:API-KEY" -1sLf 'https://dl.cloudsmith.io/basic/OWNER/REPOSITORY/cfg/setup/config.rpm.txt?distro=DISTRO&codename=VERSION' > /tmp/OWNER-REPOSITORY.repo
yum-config-manager --add-repo '/tmp/OWNER-REPOSITORY.repo'
yum -q makecache -y --disablerepo='*' --enablerepo='OWNER-REPOSITORY'
yum install yum-utils pygpgme
rpm --import 'https://dl.cloudsmith.io/basic/OWNER/REPOSITORY/cfg/gpg/gpg.FINGERPRINT.key'
curl -u "token:TOKEN" -1sLf 'https://dl.cloudsmith.io/basic/OWNER/REPOSITORY/cfg/setup/config.rpm.txt?distro=DISTRO&codename=VERSION' > /tmp/OWNER-REPOSITORY.repo
yum-config-manager --add-repo '/tmp/OWNER-REPOSITORY.repo'
yum -q makecache -y --disablerepo='*' --enablerepo='OWNER-REPOSITORY'
Dnf (Fedora)
dnf install yum-utils pygpgme
rpm --import 'https://dl.cloudsmith.io/TOKEN/OWNER/REPOSITORY/cfg/gpg/gpg.FINGERPRINT.key'
curl -1sLf 'https://dl.cloudsmith.io/TOKEN/OWNER/REPOSITORY/cfg/setup/config.rpm.txt?distro=DISTRO&codename=VERSION' > /tmp/OWNER-REPOSITORY.repo
dnf config-manager --add-repo '/tmp/OWNER-REPOSITORY.repo'
dnf -q makecache -y --disablerepo='*' --enablerepo='OWNER-REPOSITORY' --enablerepo='OWNER-REPOSITORY-source'
dnf install yum-utils pygpgme
rpm --import 'https://dl.cloudsmith.io/basic/OWNER/REPOSITORY/cfg/gpg/gpg.FINGERPRINT.key'
curl -u "USERNAME:PASSWORD" -1sLf 'https://dl.cloudsmith.io/basic/OWNER/REPOSITORY/cfg/setup/config.rpm.txt?distro=DISTRO&codename=VERSION' > /tmp/OWNER-REPOSITORY.repo
dnf config-manager --add-repo '/tmp/OWNER-REPOSITORY.repo'
dnf -q makecache -y --disablerepo='*' --enablerepo='OWNER-REPOSITORY' --enablerepo='OWNER-REPOSITORY-source'
dnf install yum-utils pygpgme
rpm --import 'https://dl.cloudsmith.io/basic/OWNER/REPOSITORY/cfg/gpg/gpg.FINGERPRINT.key'
curl -u "USERNAME:API-KEY" -1sLf 'https://dl.cloudsmith.io/basic/OWNER/REPOSITORY/cfg/setup/config.rpm.txt?distro=DISTRO&codename=VERSION' > /tmp/OWNER-REPOSITORY.repo
dnf config-manager --add-repo '/tmp/OWNER-REPOSITORY.repo'
dnf -q makecache -y --disablerepo='*' --enablerepo='OWNER-REPOSITORY' --enablerepo='OWNER-REPOSITORY-source'
dnf install yum-utils pygpgme
rpm --import 'https://dl.cloudsmith.io/basic/OWNER/REPOSITORY/cfg/gpg/gpg.FINGERPRINT.key'
curl -u "token:TOKEN" -1sLf 'https://dl.cloudsmith.io/basic/OWNER/REPOSITORY/cfg/setup/config.rpm.txt?distro=DISTRO&codename=VERSION' > /tmp/OWNER-REPOSITORY.repo
dnf config-manager --add-repo '/tmp/OWNER-REPOSITORY.repo'
dnf -q makecache -y --disablerepo='*' --enablerepo='OWNER-REPOSITORY' --enablerepo='OWNER-REPOSITORY-source'
Zypper (Suse)
curl -1sLf 'https://dl.cloudsmith.io/TOKEN/OWNER/REPOSITORY/cfg/setup/config.rpm.txt?distro=DISTRO&codename=VERSION' > /tmp/OWNER-REPOSITORY.repo
zypper ar -f '/tmp/OWNER-REPOSITORY.repo'
zypper --gpg-auto-import-keys refresh OWNER-REPOSITORY OWNER-REPOSITORY-source
curl -u "USERNAME:PASSWORD" -1sLf 'https://dl.cloudsmith.io/basic/OWNER/REPOSITORY/cfg/setup/config.rpm.txt?distro=DISTRO&codename=VERSION' > /tmp/OWNER-REPOSITORY.repo
zypper ar -f '/tmp/OWNER-REPOSITORY.repo'
zypper --gpg-auto-import-keys refresh OWNER-REPOSITORY OWNER-REPOSITORY-source
curl -u "USERNAME:API-KEY" -1sLf 'https://dl.cloudsmith.io/basic/OWNER/REPOSITORY/cfg/setup/config.rpm.txt?distro=DISTRO&codename=VERSION' > /tmp/OWNER-REPOSITORY.repo
zypper ar -f '/tmp/OWNER-REPOSITORY.repo'
zypper --gpg-auto-import-keys refresh OWNER-REPOSITORY OWNER-REPOSITORY-source
curl -u "token:TOKEN" -1sLf 'https://dl.cloudsmith.io/basic/OWNER/REPOSITORY/cfg/setup/config.rpm.txt?distro=DISTRO&codename=VERSION' > /tmp/OWNER-REPOSITORY.repo
zypper ar -f '/tmp/OWNER-REPOSITORY.repo'
zypper --gpg-auto-import-keys refresh OWNER-REPOSITORY OWNER-REPOSITORY-source
Installing a Package
Once you have setup the repository using your chosen authentication method, you can then install a package using:
Yum (RedHat, CentOS, Amazon)
sudo yum install PACKAGE_NAME-PACKAGE_VERSION.PACKAGE_ARCH
Dnf (Fedora)
sudo dnf install PACKAGE_NAME-PACKAGE_VERSION.PACKAGE_ARCH
Zypper (Suse)
sudo zypper install PACKAGE_NAME-PACKAGE_VERSION.PACKAGE_ARCH
Removing Setup
If you no longer want to install packages from your Cloudsmith repository, you can remove it with:
Yum (RedHat, CentOS, Amazon) and Dnf (Fedora)
rm /etc/yum.repos.d/OWNER-REPOSITORY.repo
rm /etc/yum.repos.d/OWNER-REPOSITORY-source.repo
Zypper (Suse)
zypper rr OWNER-REPOSITORY
zypper rr OWNER-REPOSITORY-source
Upstream Proxying / Caching
Configurable Proxying Caching
You can configure upstream RedHat repositories that you wish to use for packages that are not available in your Cloudsmith repository. In addition, you can also choose to cache any requested packages for future use.
Please see our Upstream Proxying documentation for further instructions.
Key Signing Support
GPG Index Packages
NOTE
As RPM packages are signed with a GPG key upon upload, this results in a new checksum being generated for the package.
Troubleshooting
Please see the Troubleshooting page for further help and information.
Updated 5 months ago