Rhel Packages
We often encounter RedHat Enterprise Linux servers that have not been updated because of RPM repositories not being configured or because of mission subscriptions.
As a first step, you always want to check - are there any repositories: yum repolist all
(use “dnf” instead of “yum”, if available). You will likely also see the /etc/yumrepos.d/redhat.repo
file, managed by the subscription-manager utility.
The subscription-manager can tell you if the RHEL box you are working on has an active subscription. Use subscription-manager list
or subscription-manager status
to get this info - you should not be seeing “Status: Expired” or “Overall Status: Invalid” in the output of these commands. If you do see this, you can attempt to re-register the RHEL box with:
sudo /usr/sbin/subscription-manager register --force --org org_name --activationkey the_key
sudo /usr/sbin/subscription-manager attach --auto
You can enable optional repositories with yum-config-manager --enable=<repo-id>
(where repo-id can be something like rhel-6-server-optional-rpms
)
With the needed subscription, you can then look for updates with yum check-update
or yum list obsoletes
(yum list obsoletes
can also accept a wildcard expression) and then apply the updates with yum update
(yum upgrade
is similar, but also removes obsolete packages).
Note: yum list updates
also lists updated packages in the repo that are not installed