centos使用非官方更新源
Yum Error: Cannot retrieve repository metadata (repomd.xml) for repository: dag. Please verify its path and try again
Posted by alex in Errors at 1:45 AMWhen updating CentOS or RedHat via yum its possible to receive an error similar to the below. This error will cause an issue where yum will not work even though as described below the issue is typically isolated to one yum repository.
Error:Cannot retrieve repository metadata (repomd.xml) for repository: dag. Please verify its path and try again
In the case above the issue was with the dag yum repository. There error is generic in the sense that the issue I was seeing if the fact that the server was up but that directory was either moved or was not mounted to their server properly. Yum is complaining that you need to check the path to make sure it is correct.
You have two options to resolve this yum repo issue as described below.
- Temporarily Disable Repo:You can temporarily disable the yum repository that is causing you issues by simply changing “enabled=1″ to “enabled=0″ as shown in the below dag.repo file.
Disabled Yum Repository:1name=Dag RPM RepositoryforRed Hat Enterprise Linux2baseurl=http://apt.sw.be/redhat/el$releasever/en/$basearch/dag3gpgcheck=14gpgkey=http://dag.wieers.com/rpm/packages/RPM-GPG-KEY.dag.txt5enabled=o - Use a Different Repo Mirror:The second option is to modify the baseurl variable in the .repo file with the issue. Repository files are located in /etc/yum.repos.d/. Below I commented out the problem baseurl and added a new one.
Modify Repo BaseURL:1name=Dag RPM RepositoryforRed Hat Enterprise Linux2#baseurl=http://apt.sw.be/redhat/el$releasever/en/$basearch/dag3baseurl=http://dag.linux.iastate.edu/dag/redhat/el5/en/$basearch/dag4gpgcheck=15gpgkey=http://dag.wieers.com/rpm/packages/RPM-GPG-KEY.dag.txt6enabled=1
Once you have either disabled or changed the baseurl variable yum should run without issue. If there is still an error with another yum repository you can resolve that issue as well though its fairly unlikely that two repositories would have errors at the same time so you should investigate issues on your server or with your network connection.
###################################################
http://www.21andy.com/blog/20100204/1623.html
下面以安装rpmforge和DAG软件包为例添加非官方更新源
一、添加rmpforge软件库
1)到http://dag.wieers.com/rpm/packages/rpmforge-release/查找适用于RHEL5/CentOS5的软件包。
2)下载适用于RHEL5/CentOS5的软件包。
CentOS 5 32bit
# rpm -ivh rpmforge-release-0.3.6-1.el5.rf.i386.rpm
# rpm --import /etc/pki/rpm-gpg/RPM-GPG-KEY-rpmforge-*
CentOS 5 64bit
# rpm -ivh rpmforge-release-0.3.6-1.el5.rf.x86_64.rpm
# rpm --import /etc/pki/rpm-gpg/RPM-GPG-KEY-rpmforge-*
安装rpmforge-release软件包之后,就可以看到 /etc/yum.repos.d/rpmforge.repo 文件,以后yum就可以使用这个更新源了。
二、添加dag更新仓库
输入以下内容
name=Dag RPM Repository for Red Hat Enterprise Linux
baseurl=http://apt.sw.be/redhat/el$releasever/en/$basearch/dag
gpgcheck=1
enabled=1
gpgkey=http://dag.wieers.com/rpm/packages/RPM-GPG-KEY.dag.txt
保存退出。
然后导入Key
# rpm --import RPM-GPG-KEY.dag.txt
# rm -f RPM-GPG-KEY.dag.txt //这个可以先移除也可以不移除
在定义 yum 非官方库 dag.repo 后,使用 yum 安装非官方库里定义的软件是,如果出现错误:
primary.xml.gz 100% |=========================| 883 kB 00:59
http://apt.sw.be/redhat/el5/en/i386/dag/repodata/primary.xml.gz: [Errno -1] Metadata file does not match checksum
Trying other mirror.
Error: failure: repodata/primary.xml.gz from dag: [Errno 256] No more mirrors to try.
这个错误应该是因为"/var/cache/yum/dag/”里的 primary.xml.gz 不能通过校验导致的。(暂时找不到原因,用多线程软件下载就没问题,如 myget)
这个错误的解决方法是:是用软件 myget 下载 primary.xml.gz 到 "/var/cache/yum/dag/” ;然后再重新用yum安装软件。
=================================
http://www.4ucode.com/Study/Topic/981508
在CentOS5.5下安装yum命令碰到的问题和应对方法。
1. rpm --import http://dag.wieers.com/packages/RPM-GPG-KEY.dag.txt
error: http://dag.wieers.com/packages/RPM-GPG-KEY.dag.txt: import read failed(-1).
换命令重新安装:
rpm --import http://dag.wieers.com/rpm/packages/RPM-GPG-KEY.dag.txt
2.rpm --import http://dag.wieers.com/rpm/packages/RPM-GPG-KEY.dag.txt这个命令依然报错:
error: http://dag.wieers.com/packages/RPM-GPG-KEY.dag.txt: import read failed(-1).
则在dag.repo末尾加上:
gpgkey=http://dag.wieers.com/rpm/packages/RPM-GPG-KEY.dag.txt
然后加入key:
wget http://dag.wieers.com/rpm/packages/RPM-GPG-KEY.dag.txt
rpm --import RPM-GPG-KEY.dag.txt
最后删除RPM-GPG-KEY.dag.txt
===================================
https://snipt.net/Samir/install-rpmforge-on-centos-rhel5/
Install RPMForge on CentOS (RHEL5)
# Before installing RPMforge you should import the repo key
# Import key for Dag
rpm --import http://dag.wieers.com/rpm/packages/RPM-GPG-KEY.dag.txt
# If you receive an error like the following. Try downloading then importing the key
rpm --import http://dag.wieers.com/rpm/packages/RPM-GPG-KEY.dag.txt
"error: http://dag.wieers.com/rpm/packages/RPM-GPG-KEY.dag.txt: import read
failed(-1). warning: u 0x90314e8 ctrl 0x9032328 nrefs != 0 (dag.wieers.com http)"
# Download and Import in 2 separate steps
wget http://dag.wieers.com/rpm/packages/RPM-GPG-KEY.dag.txt
rpm --import RPM-GPG-KEY.dag.txt
# Download the actual RPMForge rpm. ( newest version at time of writing )
# Browse to http://packages.sw.be/rpmforge-release/ to check what's available.
# Interestingly, there are already RHEL6 packages available there.
wget http://packages.sw.be/rpmforge-release/rpmforge-release-0.5.2-2.el5.rf.i386.rpm
# For 64bit
wget http://packages.sw.be/rpmforge-release/rpmforge-release-0.5.2-2.el5.rf.x86_64.rpm
# If you want to script this, make it portable with environment variables
wget http://packages.sw.be/rpmforge-release/rpmforge-release-0.5.2-2.$dist.rf.$arch.rpm
# Verify package integrity
rpm -K rpmforge-release-0.5.2-2.el5.rf.i386.rpm
# Install package
rpm -i rpmforge-release-0.5.1-1.el5.rf.i386.rpm
# Alternate installation command. "Uvh" is a common way to install/upgrade with nicer output
rpm -Uvh rpmforge-release-0.5.1-1.el5.rf.i386.rpm
# Again, using environment variables
rpm -Uhv rpmforge-release-0.5.1-1.$dist.rf.$arch.rpm

浙公网安备 33010602011771号