
The baseurl directive in your .repo files in the /etc/yum.repos.d directory often contains the $releasever (Release Server) variable, something like this.
~]# grep -i baseurl /etc/yum.repos.d/redhat.repo
baseurl = https://satellite.example.com/pulp/content/rhel7/content/dist/rhel/server/7/$releasever/$basearch/optional/os
Sometimes, the $releasever variable in derived from the distroverpkg variable in the /etc/yum.conf file, something like this.
~]$ cat /etc/yum.conf
distroverpkg=8.9
The subscription-manager release command can be used to determine if the release has been set by Subscription Manager. Often, it is not set.
~]# subscription-manager release
Release not set
The subscription-manager release --list command can be used to list the available releases.
~]# subscription-manager release --list
+-------------------------------------------+
Available Releases
+-------------------------------------------+
7Server
8.9
The subscription-manager release --set=<release> command can be used to set Subscription Manager to a specific release.
subscription-manager release --set=7Server
This should update /etc/yum.repos.d/redhat.repo immediately. Notice now basesurl has 7Server instead of $releasever.
~]# grep -i baseurl /etc/yum.repos.d/redhat.repo
baseurl = https://satellite.example.com/pulp/content/rhel7/content/dist/rhel/server/7/7Server/$basearch/optional/os
The subscription-manager release --unset command can be used to unset the Release.
~]# subscription-manager release --unset
Release preference has been unset
This should update /etc/yum.repos.d/redhat.repo immediately. Notice now basesurl has $releasever instead of 7Server.
~]# grep -i baseurl /etc/yum.repos.d/redhat.repo
baseurl = https://satellite.example.com/pulp/content/rhel7/content/dist/rhel/server/7/$releasever/$basearch/optional/os
Did you find this article helpful?
If so, consider buying me a coffee over at