yum fails with the error "[Errno 14] HTTP Error 400: Bad Request".

Solution Verified - Updated -

Environment

  • Red Hat Enterprise Linux 5 and above

Issue

  • The yum fails with the following error,
# yum update
Loaded plugins: product-id, rhnplugin, security, subscription-manager
Updating Red Hat repositories.
https://cdn.redhat.com/content/dist/rhel/server/5/5Server/i386/cf-tools/1.0/os/repodata/repomd.xml: [Errno 14] HTTP Error 400: Bad Request
Trying other mirror.
Error: Cannot retrieve repository metadata (repomd.xml) for repository: rhel-5-server-cf-tools-1-rpms. Please verify its path and try again
  • yum update fails with
Error Downloading Packages: 
  libstdc++-4.1.2-46.el5_4.2.x86_64: failed to retrieve getPackage/libstdc++-4.1.2-46.el5_4.2.x86_64.rpm from rhel-x86_64-server-5 
error was [Errno 14] HTTP Error 400: Bad Request 
  nscd-2.5-42.el5_4.3.x86_64: failed to retrieve getPackage/nscd-2.5-42.el5_4.3.x86_64.rpm from rhel-x86_64-server-5 
error was [Errno 14] HTTP Error 400: Bad Request 
8.x86_64.rpm from rhel-x86_64-server-5 
error was [Errno 14] HTTP Error 400: Bad Request 

Resolution

  • Move the redhat.repo file under /etc/yum.repos.d to a different location.
  • Disable Location Aware Updates for the system.
  • Disable any custom repo if present in /etc/yum.repos.d
    Edit from "enable=1" to "enable=0"
  • Check if any proxy entry mentioned in /etc/yum.conf
  • Now on the client system execute below commands:
# yum clean all
# yum update

Root Cause

  • With new certificate based management,systems are using plugins along with redhat.repo to pull system updates.
  • If the system is registered with RHN-Classic, redhat.repo is not needed.

Diagnostic Steps

  • Try yum list command as below and observe output,
# rm -rf /var/cache/yum/*
# yum clean all
# yum list
  • Component
  • yum

This solution is part of Red Hat’s fast-track publication program, providing a huge library of solutions that Red Hat engineers have created while supporting our customers. To give you the knowledge you need the instant it becomes available, these articles may be presented in a raw and unedited form.

Comments