yum failure Error importing repomd.xml

General support questions
Post Reply
koval
Posts: 2
Joined: 2021/06/08 12:36:30

yum failure Error importing repomd.xml

Post by koval » 2021/06/08 12:48:08

Hello,
I am new person, come from Debian world to Redhat like system.

What I did:
  • Downloaded CentOS 7 and installed in VirtualBox
  • Made command

    Code: Select all

    yum update
    and got error

Code: Select all

failure: repodata/repomd.xml from base: [Errno 256] No more mirrors to try.
http://mirror.centos.org/centos/7/os/x86_64/repodata/repomd.xml: [Errno -1] Error importing repomd.xml for base: Damaged repomd.xml file
Output of repomd.xml

Code: Select all

[root@localhost ~]# curl http://mirror.centos.org/centos/7/os/x86_64/repodata/repomd.xml
<?xml version="1.0" encoding="UTF-8"?>
<repomd xmlns="http://linux.duke.edu/metadata/repo" xmlns:rpm="http://linux.duke.edu/metadata/rpm">
 <revision>1604001756</revision>
<data type="group">
  <checksum type="sha256">cca56f3cffa18f1e52302dbfcf2f0250a94c8a37acd8347ed6317cb52c8369dc</checksum>
  <location href="repodata/cca56f3cffa18f1e52302dbfcf2f0250a94c8a37acd8347ed6317cb52c8369dc-c7-x86_64-comps.xml"/>
  <timestamp>1604001780</timestamp>
  <size>744670</size>
</data>
<data type="filelists">
  <checksum type="sha256">5319616dde574d636861a6e632939f617466a371e59b555cf816cf1f52f3e873</checksum>
  <open-checksum type="sha256">31d415a3a6e062a7f613729b736ff64dfe8dc5abaede7952e95f98540726ea76</open-checksum>
  <location href="repodata/5319616dde574d636861a6e632939f617466a371e59b555cf816cf1f52f3e873-filelists.xml.gz"/>
  <timestamp>1604001766</timestamp>
  <size>7474108</size>
  <open-size>108133174</open-size> ....

System info

Code: Select all

[root@localhost ~]# cat /etc/os-release
NAME="CentOS Linux"
VERSION="7 (Core)"
ID="centos"
ID_LIKE="rhel fedora"
VERSION_ID="7"
PRETTY_NAME="CentOS Linux 7 (Core)"
ANSI_COLOR="0;31"
CPE_NAME="cpe:/o:centos:centos:7"
HOME_URL="https://www.centos.org/"
BUG_REPORT_URL="https://bugs.centos.org/"

CENTOS_MANTISBT_PROJECT="CentOS-7"
CENTOS_MANTISBT_PROJECT_VERSION="7"
REDHAT_SUPPORT_PRODUCT="centos"
REDHAT_SUPPORT_PRODUCT_VERSION="7"

Can someone give me advice ?

User avatar
TrevorH
Site Admin
Posts: 33263
Joined: 2009/09/24 10:40:56
Location: Brighton, UK

Re: yum failure Error importing repomd.xml

Post by TrevorH » 2021/06/08 12:54:20

Try yum clean all then try it again. If that fails still then check you have a direct connection to the internet - i.e. no web proxy - or if htere is a web proxy in the middle then read man yum.conf and specify the proxy*= variables you need in /etc/yum.conf to get authorized to use it.
The future appears to be RHEL or Debian. I think I'm going Debian.
Info for USB installs on http://wiki.centos.org/HowTos/InstallFromUSBkey
CentOS 5 and 6 are deadest, do not use them.
Use the FAQ Luke

koval
Posts: 2
Joined: 2021/06/08 12:36:30

Re: yum failure Error importing repomd.xml

Post by koval » 2021/06/08 13:05:35

Ok, thanks. I did it in my office. I will ask our network admin's.

xxOOxx
Posts: 3
Joined: 2023/12/07 04:31:16

Re: yum failure Error importing repomd.xml

Post by xxOOxx » 2023/12/07 04:43:34

have the same issue. CentOS supposed to still have a half year support but its main repos base and updates are not accessible
failure: repodata/repomd.xml from base: [Errno 256] No more mirrors to try.
http://mirror.centos.org/centos/7/os/x8 ... repomd.xml: [Errno -1] Error importing repomd.xml for base: Damaged repomd.xml file
though in browser http://mirror.centos.org/centos/7/os/x8 ... repomd.xml looks fine
I've uncommented baseurl=http://mirror.centos.org/centos/$releas ... $basearch/
in /etc/yum.repos.d/CentOS-Base.repo though before it has not been required, the mirrors have been used by default

User avatar
TrevorH
Site Admin
Posts: 33263
Joined: 2009/09/24 10:40:56
Location: Brighton, UK

Re: yum failure Error importing repomd.xml

Post by TrevorH » 2023/12/07 14:53:36

There are no known problems with the CentOS 7 repos or mirrors. I suspect the problem is your end and that you are behind some form of caching web proxy that has helpfully saved a broken copy and is serving it to you instead of the real thing. There is an http_cahcing= parameter you can add to yum.conf that tells it to tell any proxy to not give it a cached copy - see man yum.conf for details.
The future appears to be RHEL or Debian. I think I'm going Debian.
Info for USB installs on http://wiki.centos.org/HowTos/InstallFromUSBkey
CentOS 5 and 6 are deadest, do not use them.
Use the FAQ Luke

xxOOxx
Posts: 3
Joined: 2023/12/07 04:31:16

Re: yum failure Error importing repomd.xml

Post by xxOOxx » 2023/12/09 23:53:18

thanks for your reply, TrevorH. I do not use proxies. I think the issue is that while browses can read the mirrorlist and baseurl. curl and looks like yum - can't. Not sure why it had happened but it explains why previously commented baseurl now became required.

xxOOxx
Posts: 3
Joined: 2023/12/07 04:31:16

Re: yum failure Error importing repomd.xml

Post by xxOOxx » 2023/12/10 00:02:02

file wasn't readable because of it's compressed

Code: Select all

curl -sH 'Accept-encoding: gzip'  'http://mirrorlist.centos.org/?release=7&arch=x86_64&repo=os&infra=1' |gunzip -
resolves curl issue.
But looks like yum needs decompressed content at the input but doesn't do decompression on its own.

Post Reply