1、清空缓存
执行:
# yum clean all
先把就的缓存数据都去掉。
2、下载metadata和校验数据
先进入yum对应的目录,再下载:
# cd /var/cache/yum/rpmforge
# wget --cache=off http://apt.sw.be/redhat/el4/en/i386/dag/repodata/repomd.xml
# wget --cache=off http://apt.sw.be/redhat/el4/en/i386/dag/repodata/primary.xml.gz
# wget --cache=off http://apt.sw.be/redhat/el4/en/i386/dag/repodata/filelists.xml.gz
# wget --cache=off http://apt.sw.be/redhat/el4/en/i386/dag/repodata/other.xml.gz
# wget --cache=off http://apt.sw.be/redhat/el4/en/i386/dag/repodata/repomd.xml
# wget --cache=off http://apt.sw.be/redhat/el4/en/i386/dag/repodata/primary.xml.gz
# wget --cache=off http://apt.sw.be/redhat/el4/en/i386/dag/repodata/filelists.xml.gz
# wget --cache=off http://apt.sw.be/redhat/el4/en/i386/dag/repodata/other.xml.gz
3、校验数据
执行:
引用
# sha1sum other.xml.gz filelists.xml.gz primary.xml.gz
74fcc9f9e218cfdbc1ac2b5ac17ff7d912267bdf other.xml.gz
3f4b2e9a5efc67c0cdf329c69f041daa82a2346c filelists.xml.gz
bd2033e1fd7a7d1f1b92ce7b880919bd685217f8 primary.xml.gz
74fcc9f9e218cfdbc1ac2b5ac17ff7d912267bdf other.xml.gz
3f4b2e9a5efc67c0cdf329c69f041daa82a2346c filelists.xml.gz
bd2033e1fd7a7d1f1b92ce7b880919bd685217f8 primary.xml.gz
对比repomd.xml中的信息:
引用
# cat repomd.xml |grep -w 'checksum'|grep -v 'open-checksum'
<checksum type="sha">74fcc9f9e218cfdbc1ac2b5ac17ff7d912267bdf</checksum>
<checksum type="sha">3f4b2e9a5efc67c0cdf329c69f041daa82a2346c</checksum>
<checksum type="sha">bd2033e1fd7a7d1f1b92ce7b880919bd685217f8</checksum>
<checksum type="sha">74fcc9f9e218cfdbc1ac2b5ac17ff7d912267bdf</checksum>
<checksum type="sha">3f4b2e9a5efc67c0cdf329c69f041daa82a2346c</checksum>
<checksum type="sha">bd2033e1fd7a7d1f1b92ce7b880919bd685217f8</checksum>
若数据正确,则说明metadata和校验数据是匹配的。可以使用yum更新了,不会再重新下载metadata。
否则,可以再等待一下,或需要从其他的镜像获取更新咯。