Hello everyone,
When you migrate your RHEL 9 server to any cloud provider (AWS, Azure, or GCP) using lift&shift or similar migration methods/solutions, you may encounter issues related to package updates. After starting the server, if you run “yum update
” or “dnf update
” and receive an error message similar to the one below, follow the steps outlined in this article to resolve the problem.
[root@ip-10-199-xxx-xxx ~]# sudo yum update
Updating Subscription Management repositories.
Unable to read consumer identity
This system is not registered with an entitlement server. You can use subscription-manager to register.
Red Hat Enterprise Linux 9 for x86_64 - AppStream from RHUI (RPMs) 2.9 kB/s | 153 B 00:00
Errors during downloading metadata for repository 'rhel-9-appstream-rhui-rpms':
- Status code: 403 for https://rhui.eu-central-1.aws.ce.redhat.com/pulp/content/content/dist/rhel9/rhui/9/x86_64/appstream/os/repodata/repomd.xml (IP: 18.192.84.171)
Error: Failed to download metadata for repo 'rhel-9-appstream-rhui-rpms': Cannot download repomd.xml: Cannot download repodata/repomd.xml: All mirrors were tried
If you encounter this error, it’s important to recognize that the issue is likely related to RHUI (Red Hat Update Infrastructure). RHUI is a content delivery system provided by Red Hat, specifically designed for cloud environments such as AWS, Azure, and GCP. It allows RHEL users to receive updates and packages without directly registering their systems with Red Hat.
When you launch a server on AWS, Azure, or GCP, updates are delivered via RHUI, which acts as a proxy—similar to how Red Hat’s native repositories function. You can think of it as the mechanism that enables RHEL instances acquired via cloud marketplaces (e.g., AWS Marketplace) to operate without manual registration.
However, when a server has been migrated (e.g., via lift-and-shift), you’re proceeding with a BYOL (Bring Your Own License) approach, and if the system was previously registered with Red Hat, conflicts may arise.
To avoid these issues:
- Uninstall the RHUI client from the system.
- Deregister the server from Red Hat, making sure to also clear any cached data.
- If needed, update the hostname at this stage.
- Finally, re-register the system with Red Hat using the appropriate subscription method.
These steps help eliminate RHUI-related conflicts and ensure that your system is properly registered and able to receive updates in its new environment. Here are the commands:
yum remove -y rh-amazon-rhui-client // for AWS
yum remove -y rhui-azure-rhel* rhui-client-config-azure rhui-microsoft-azure-rhel // for Azure
yum remove -y google-rhui-client* rhui-client-config-google // for GCP
subscription-manager remove --all
subscription-manager unregister
subscription-manager clean
yum clean all
rm -rf /var/cache/yum/*
subscription-manager register
subscription-manager attach --auto
After completing these steps, you’ll need to re-enable the repositories. For RHEL 9, you can use the following commands:
subscription-manager repos --enable=rhel-9-for-x86_64-baseos-rpms
subscription-manager repos --enable=rhel-9-for-x86_64-appstream-rpms
If you encounter the warning “Repositories disabled by configuration.” at this stage, open the “/etc/rhsm/rhsm.conf
” file and check whether the value of “manage_repos
” is set to 1
. If it’s not, it may have been disabled by “subscription-manager
“. Change the value to 1
and save the file.
Then, run the following commands again:
subscription-manager refresh
subscription-manager repos --enable=rhel-9-for-x86_64-baseos-rpms
subscription-manager repos --enable=rhel-9-for-x86_64-appstream-rpms
yum clean all && yum update
I hope these steps help save you time in resolving the issue.
References: