I ran yum or dnf commands in my Amazon Elastic Compute Cloud (Amazon EC2) instance that runs Red Hat Enterprise Linux (RHEL). However, I received the "This system is not registered with an entitlement server. You can use subscription-manager to register." error message.
Short description
RHEL EC2 instances that you launch from Amazon Machine Images (AMIs) use the Red Hat Update Infrastructure (RHUI) for package management, not subscription-manager. However, the subscription-manager plugin is activated by default. As a result, yum and dnf check for registration and display a warning even if RHUI correctly provides the packages. The warning is cosmetic and doesn't affect your ability to install or update packages.
To resolve the warning message, first check whether there's an actual repository issue. If the message is only the cosmetic subscription-manager warning, then remove the warning message.
Resolution
Check whether there's an actual repository issue
If you receive the "not registered" error message, but the yum or dnf commands still successfully complete, then there's no repository issue. The packages can install and update without errors, so the warning message is cosmetic.
If you packages fail to install, then there are repository issues. Or, you might receive errors such as "Cannot find a valid baseurl for repo" or "Error: Failed to download metadata for repo". These issues occur when there are RHUI connectivity, network configuration, or RHUI certificate issues. They aren't related to the subscription-manager registration. To resolve these issues, check your RHUI client configuration, network access to RHUI endpoints, and certificate validity. To troubleshoot repository errors, see Why do I receive errors when I use yum on my Amazon EC2 instance that runs RHEL?
Remove the warning message
Complete the following steps:
-
Run the following command to confirm that your instance has a billing or AWS Marketplace product code:
TOKEN=$(curl -X PUT "http://169.254.169.254/latest/api/token" -H "X-aws-ec2-metadata-token-ttl-seconds: 21600") && curl -H "X-aws-ec2-metadata-token: $TOKEN" http://169.254.169.254/latest/dynamic/instance-identity/document -q 2>/dev/null | grep -iE 'BillingProduct|marketplace'
Note: The licensing and repositories for your instance depend on the billing or AWS Marketplace product code that the instance inherits from its AMI. They also depend on the RHUI client that you install in the instance's operating system (OS).
Example output:
$ TOKEN=$(curl -X PUT "http://169.254.169.254/latest/api/token" -H "X-aws-ec2-metadata-token-ttl-seconds: 21600") && curl -H "X-aws-ec2-metadata-token: $TOKEN" http://169.254.169.254/latest/dynamic/instance-identity/document -q 2>/dev/null | grep -iE 'BillingProduct|marketplace'
% Total % Received % Xferd Average Speed Time Time Time Current
Dload Upload Total Spent Left Speed
100 56 100 56 0 0 28070 0 --:--:-- --:--:-- --:--:-- 56000
"billingProducts" : [ "bp-6fa54006" ],
"marketplaceProductCodes" : null,
-
To back up your configuration file, run the following command:
sudo cp -aprf /etc/yum/pluginconf.d/subscription-manager.conf /etc/yum/pluginconf.d/subscription-manager.conf.back_`date +%F`
-
To change enabled=1 to enabled=0 and deactivate subscription-manager, run the following command based on your RHEL version.
RHEL 7:
sudo sed -i 's/enabled[ ]*=[ ]*1/enabled=0/g' /etc/yum/pluginconf.d/subscription-manager.conf
RHEL 8, 9, and 10:
sudo sed -i 's/enabled[ ]*=[ ]*1/enabled=0/g' /etc/dnf/plugins/subscription-manager.conf
-
To confirm that you removed the error message, run the following command:
sudo yum update
Related information
Yum displays system not registered warning in RHUI based clients on the Red Hat website
Red Hat Enterprise Linux on Amazon EC2 FAQs