The subscription-manager codebase is on GitHub. The project is built for the latest versions of Fedora (and submitted to Fedora Updates), CentOS Stream and RHEL.
To install subscription-manager, run
sudo dnf install subscription-manager
RHEL already comes with subscription-manager
pre-installed. With subscription-manager
present, you can get register the system with your Red Hat account by running
sudo subscription-manager register
The process below has been tested on Fedora 36 and RHEL 9. Other versions or distributions may require some adaptation.
-
First you need to install RPM packages to build and run subscription-manager binaries:
sudo dnf install git gcc python3-devel openssl-devel glib2-devel \ python3-rpm python3-librepo libdnf-devel cmake
On RHEL, you need to enable the CodeReady Linux Builder repository in order to gain access to the development packages like
libdnf-devel
.sudo subscription-manager repos --enable codeready-builder-for-rhel-9-x86_64-rpms
-
Install the
subscription-manager
RPM (not required for RHEL) and packages required to run the test suite:NOTE: Installing
subscription-manager
package is not strictly necessary even on Fedora, but it will pull down all dependencies and create all the files used by subscription-manager.sudo dnf install --setopt install_weak_deps=False subscription-manager \ dbus-daemon glibc-langpack-en glibc-langpack-de glibc-langpack-ja
-
Install Python packages in virtual environment to prevent polluting userspace:
NOTE: This step is optional.
sudo dnf install python3-pip mkdir -p ~/.venvs/ python3 -m venv --system-site-packages ~/.venvs/subscription-manager source ~/.venvs/subscription-manager/bin/activate python3 -m pip install wheel
-
Clone the repository:
git clone https://github.com/candlepin/subscription-manager.git cd subscription-manager/
-
Build the project:
./setup.py build ./setup.py build_ext --inplace
-
Test your local installation:
sudo PYTHONPATH=./src python3 -m subscription_manager.scripts.subscription_manager
NOTE: Adjust the path accordingly.
You can setup an alias in
.bashrc
(or equivalent), so you can run it more easily:alias subscription-manager="sudo \ PYTHONPATH=/path/to/subscription-manager/src \ $(which python3) \ -m subscription_manager.scripts.subscription_manager"
-
You can also set up aliases for rhsm.service and rhsmcertd.service.
NOTE: Adjust the paths accordingly.
alias rhsm-service="sudo \ PYTHONPATH=/path/to/subscription-manager/src \ $(which python3) \ -m subscription_manager.scripts.rhsm_service --verbose" alias rhsmcertd="sudo \ PYTHONPATH=/path/to/subscription-manager/src \ $(which python3) \ -m subscription_manager.scripts.rhsmcertd_worker"
Before you run rhsm service manually, ensure you have disabled the system service first:
sudo systemctl stop rhsm.service