yum 损坏的repomd.xml 文件

yum 损坏的repomd.xml 文件

我在 Fedora 16 上使用 yum 执行任何操作时遇到问题。以下是我得到的输出:

[user@mycomputer yum-3.4.3]$ sudo yum update
[sudo] password for user: 
Loaded plugins: langpacks, presto, priorities, refresh-packagekit
adobe-linux-x86_64                                                                                                                                                                                                                                                                                    |   39 B     00:00 ... 
http://linuxdownload.adobe.com/linux/x86_64/repodata/repomd.xml: [Errno -1] Error importing repomd.xml for adobe-linux-x86_64: Damaged repomd.xml file
Trying other mirror.
fedora                                                                                                                                                                                                                                                                                                |   39 B     00:00 ... 
http://download.fedoraproject.org/pub/fedora/linux/releases/16/Everything/x86_64/os/repodata/repomd.xml: [Errno -1] Error importing repomd.xml for fedora: Damaged repomd.xml file
Trying other mirror.
YumRepo Error: All mirror URLs are not using ftp, http[s] or file.
 Eg. Protocol mismatch./
removing mirrorlist with no valid mirrors: /var/cache/yum/x86_64/16/rpmfusion-free/mirrorlist.txt
YumRepo Error: All mirror URLs are not using ftp, http[s] or file.
 Eg. Protocol mismatch./
removing mirrorlist with no valid mirrors: /var/cache/yum/x86_64/16/rpmfusion-free-updates/mirrorlist.txt
YumRepo Error: All mirror URLs are not using ftp, http[s] or file.
 Eg. Protocol mismatch./
removing mirrorlist with no valid mirrors: /var/cache/yum/x86_64/16/rpmfusion-nonfree/mirrorlist.txt
YumRepo Error: All mirror URLs are not using ftp, http[s] or file.
 Eg. Protocol mismatch./
removing mirrorlist with no valid mirrors: /var/cache/yum/x86_64/16/rpmfusion-nonfree-updates/mirrorlist.txt
updates                                                                                                                                                                                                                                                                                               |   39 B     00:00 ... 
http://download.fedoraproject.org/pub/fedora/linux/updates/16/x86_64/repodata/repomd.xml: [Errno -1] Error importing repomd.xml for updates: Damaged repomd.xml file
Trying other mirror.
adobe-linux-x86_64                                                                                                                                                                                                                                                                                    |   39 B     00:00 ... 
http://linuxdownload.adobe.com/linux/x86_64/repodata/repomd.xml: [Errno -1] Error importing repomd.xml for adobe-linux-x86_64: Damaged repomd.xml file
Trying other mirror.
Error: failure: repodata/repomd.xml from adobe-linux-x86_64: [Errno 256] No more mirrors to try

这是我的 /etc/yum.conf 的内容:

[user@mycomputer yum-3.4.3]$ cat /etc/yum.conf                                                                                                                                                                                                                                                                               
[main]                                                                                                                                                                                                                                                                                                                       
cachedir=/var/cache/yum/$basearch/$releasever                                                                                                                                                                                                                                                                                
keepcache=0                                                                                                                                                                                                                                                                                                                  
debuglevel=2                                                                                                                                                                                                                                                                                                                 
logfile=/var/log/yum.log                                                                                                                                                                                                                                                                                                     
exactarch=1                                                                                                                                                                                                                                                                                                                  
obsoletes=1                                                                                                                                                                                                                                                                                                                  
gpgcheck=1                                                                                                                                                                                                                                                                                                                   
plugins=1                                                                                                                                                                                                                                                                                                                    
installonly_limit=3                                                                                                                                             
proxy=http://xx.xx.xx.xx:xxxx
PROXY_USERNAME=user
PROXY_PASSWORD=password

以下是 /etc/yum.repos.d/fedora.repo 的内容:

[user@mycomputer yum-3.4.3]$ cat /etc/yum.repos.d/fedora.repo 
[fedora]
name=Fedora $releasever - $basearch
failovermethod=priority
#baseurl=http://download.fedoraproject.org/pub/fedora/linux/releases/$releasever/Everything/$basearch/os/
mirrorlist=https://mirrors.fedoraproject.org/metalink?repo=fedora-$releasever&arch=$basearch
enabled=1
metadata_expire=7d
gpgcheck=1
gpgkey=file:///etc/pki/rpm-gpg/RPM-GPG-KEY-fedora-$basearch

[fedora-debuginfo]
name=Fedora $releasever - $basearch - Debug
failovermethod=priority
#baseurl=http://download.fedoraproject.org/pub/fedora/linux/releases/$releasever/Everything/$basearch/debug/
mirrorlist=https://mirrors.fedoraproject.org/metalink?repo=fedora-debug-$releasever&arch=$basearch
enabled=0
metadata_expire=7d
gpgcheck=1
gpgkey=file:///etc/pki/rpm-gpg/RPM-GPG-KEY-fedora-$basearch

[fedora-source]
name=Fedora $releasever - Source
failovermethod=priority
#baseurl=http://download.fedoraproject.org/pub/fedora/linux/releases/$releasever/Everything/source/SRPMS/
mirrorlist=https://mirrors.fedoraproject.org/metalink?repo=fedora-source-$releasever&arch=$basearch
enabled=0
metadata_expire=7d
gpgcheck=1
gpgkey=file:///etc/pki/rpm-gpg/RPM-GPG-KEY-fedora-$basearch

有人对如何解决这个问题有任何想法吗?

答案1

repomd.xml这不是您的(存储库元数据)的损坏。我在这里看到两个可能的问题:

  • 您的代理服务器有一份陈旧的部分检索副本,或者只是拒绝提供一份好的副本。
  • 错误的副本被放置到存储库主服务器上,然后所有镜像都将其拉出(我曾经看到过它)。无论如何,在我写响应时,第一个选择的镜像返回了一个有效文件。

你的fedora.repo文件没问题。

答案2

yum.conf我通过在我的文件中添加最初丢失的代理标签来使其工作。

答案3

  1. 打开 yum.conf

    vi /etc/yum.conf
    
  2. 在最后添加“代理”标签

    proxy=http://XXXX.XXX.XXXX.XXX:XXXX
    

保存并关闭。这应该有效。

答案4

用这个:

# sudo yum clean all
# sudo yum update

相关内容