If you are running a Red Hat Enterprise Linux (RHEL) 8 virtual machine on Microsoft Azure, you may occasionally run into a disruptive error when executing your standard security updates.
The system will report that it is not registered with an entitlement server and will fail to download critical metadata from the Red Hat Update Infrastructure (RHUI) server, throwing an HTTP Status Code 400. [1, 2]
This step-by-step guide explains how to quickly resolve this mirror issue and get your regular updates working again.
The Problem
When running
sudo yum update --security, the process halts with an output that looks like this:text
sudo yum update --security
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 8 for x86_64 - BaseOS from RHUI (RPMs) 140 B/s | 215 B 00:01
Errors during downloading metadata for repository 'rhel-8-for-x86_64-baseos-rhui-rpms':
- Status code: 400 for https://rhui4-1.microsoft.com/pulp/repos/content/dist/rhel8/rhui/8/x86_64/baseos/os/repodata/repomd.xml (IP: 20.225.226.182)
Error: Failed to download metadata for repo 'rhel-8-for-x86_64-baseos-rhui-rpms': Cannot download repomd.xml: Cannot download repodata/repomd.xml: All mirrors were tried
This error usually indicates that your local cache is corrupted or your Azure RHUI client package needs to force-refresh its configuration with the Microsoft update repositories.
The Solution
You do not need to register with a standard Red Hat Subscription Manager if you are using an Azure Pay-As-You-Go (PAYG) image. Instead, execute the following commands in your terminal to fix the repository mappings:
1. Clean the YUM Cache [1]
First, wipe all cached data and tracking cookies from your package manager to eliminate corrupted repository metadata:
bash
sudo yum clean all
Force YUM to bypass other broken repositories, look specifically for Microsoft-related configurations, and update the Azure-RHEL8 infrastructure client:
bash
sudo yum update -y --disablerepo="*" --enablerepo="*microsoft*" rhui-azure-rhel8
3. Run Security Updates Again
With the client configuration corrected, your standard security updates will now function perfectly:
bash
sudo yum update --security
Conclusion
Your RHEL 8 environment on Azure should now pull packages seamlessly from the updated mirror endpoints!
Found this fix helpful? Save it to your bookmarks and share it with your fellow Linux Administrators!