{"id":105,"date":"2023-06-05T13:14:22","date_gmt":"2023-06-05T05:14:22","guid":{"rendered":"http:\/\/pro369.com\/linux\/?p=105"},"modified":"2019-05-21T09:10:01","modified_gmt":"2019-05-21T09:10:01","slug":"%e8%a7%a3%e6%b1%bametadata-file-does-not-match-checksum%e9%8c%af%e8%aa%a4","status":"publish","type":"post","link":"https:\/\/por.tw\/linux\/%e8%a7%a3%e6%b1%bametadata-file-does-not-match-checksum%e9%8c%af%e8%aa%a4\/","title":{"rendered":"\u89e3\u6c7aMetadata file does not match checksum\u932f\u8aa4"},"content":{"rendered":"<p><strong><font color=\"#800080\">&nbsp;\u89e3\u6c7aMetadata file does not match checksum\u932f\u8aa4<br \/> <\/font><br \/> \u5728\u4f7f\u7528yum\u66f4\u65b0\u5305\u7684\u6642\u5019\uff0c\u5e38\u5831\u4e0b\u9762\u7684\u932f\u8aa4\uff1a<br \/> \u5f15\u7528<br \/> Reading repository metadata in from local files<br \/> primary.xml.gz&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; 100% |=========================| 1.7 MB&nbsp;&nbsp;&nbsp; 02:25<br \/> http:\/\/www.mirrorservice.org\/sites\/apt.sw.be\/redhat\/el4\/en\/i386\/dag\/repodata\/primary.xml.gz:<br \/> [Errno -1] Metadata file does not match checksum<br \/> Trying other mirror.<\/p>\n<p> &nbsp;&nbsp; \u6709\u6642\u5019\u7576\u7f6e\u63db\u4e86\u5e7e\u500b\u5c0d\u6620\u5f8c\u5c31\u53ef\u4ee5\u4e86\u3002\u4f46\u7d93\u5e38\u4e5f\u6703\u767c\u73fe\u6700\u7d42\u662f\u5931\u6557\u7684\u3002\u7531\u65bc\u6211\u7684\u7cfb\u7d71\u662f\u4f9d\u8cf4yum\u66f4\u65b0\u7684\uff0c\u82e5\u4f7f\u7528\u570b\u5916\u7db2\u8def\u6e90\u7684\u6642\u5019\u51fa\u9019\u6a23\u7684\u554f\u984c\uff0c\u5f71\u97ff\u633a\u5927\u7684\u3002<br \/> &nbsp;&nbsp; Google\u641c\u5c0b\u4e86\u4e00\u4e0b\uff0c\u662f\u4e00\u500b\u5e38\u898b\u554f\u984c\uff0c\u4e5f\u63d0\u4f9b\u4e86\u4e00\u4e9b\u65b9\u6cd5\u3002\u53ea\u662f\u5f8c\u4f86\u767c\u73fe\uff0c\u9019\u4e9b\u65b9\u6cd5\u8981\u4e0d\u5c31\u662f\u6c92\u6709\u8aaa\u6e05\u695a\uff0c\u8981\u4e0d\u5c31\u662f\u8aa4\u89e3\u3002\u7d93\u7531\u6e2c\u8a66\uff0c\u6700\u7d42\u57fa\u672c\u53ef\u4ee5\u89e3\u6c7a\u4e86\u3002<br \/> <\/strong><br \/> <img loading=\"lazy\" decoding=\"async\" src=\"https:\/\/visdacom.com\/linux\/wp-content\/uploads\/2013\/04\/5007024031.jpg\"  width=\"680\" height=\"863\" \/><strong><\/p>\n<p> \u4e00\u3001\u539f\u56e0<br \/> \u5f9e\u8a72\u4f4d\u5740\u627e\u5230\u4e00\u6bb5\u8aaa\u660e\uff1a\u9ede\u64ca<br \/> \u5f15\u7528<br \/> To reduce load, download.fedora.redhat.com (official host) contains the ~1kB checksum for the metadata. The metadata (usually ~1 &#8211; 2 MB) is downloaded off mirrors. After downloading metadata, Yum compares the two to make sure they&#39;re one and the same.<br \/> Now, think of this: download.fedora.redhat.com updates their metadata and checksums, so you&#39;re getting the new checksum. The mirror&#39;s cronjobs havn&#39;t gone yet, therefore no synching and the metadata isn&#39;t the newest, it doesn&#39;t match.<\/p>\n<p> The solution is not to makecache; Although it may help it will take forever and still not 100% solve the problem. The main problem is not giving the mirrors enough synch time. Typically, cron runs every hour, and give it a bit of time to download the changes, so I&#39;d say try running maybe 10 minutes after an hour and you&#39;ll have no problem (eg 3:10, 4:10, 5:10, etc&#8230;). If you get closer to :50 (3:50, :50, etc) you&#39;ll start seeing more syncing issues.<\/p>\n<p> Again, this too isn&#39;t 100% perfect but more of a guideline. There&#39;s a lot of guesswork&#8230;<\/p>\n<p> \u5927\u6982\u7684\u610f\u601d\u662f\u8aaa\uff1a<br \/> \u5f15\u7528<br \/> \u7576 \u751f\u6210metadata\u8cc7\u6599\u7684\u6642\u5019\uff0c\u6703\u4e00\u540c\u7522\u751f\u6821\u9a57\u8cc7\u6599\u3002\u800c\u50b3\u8f38\u7684\u6642\u5019\uff0c\u6703\u7528\u8a72\u6821\u9a57\u8cc7\u6599\u5224\u65b7metadata\u662f\u5426\u5b8c\u6574\u3002\u9019\u6642\u5019\u5c31\u6703\u7522\u751f\u4e00\u500b\u554f \u984c\uff0cmirror\u5c0d\u6620\u7576\u5f9e\u6e90\u7db2\u8def\u8986\u5236\u8cc7\u6599\u56de\u4f86\u6642\uff0c\u4e0b\u8f09\u4e86metadata\uff0c\u4f46\u9084\u6c92\u4e0b\u8f09\u6821\u9a57\u8cc7\u6599\uff08\u6216\u7531\u5b9a\u6642\u4efb\u52d9\u7522\u751f\u6821\u9a57\u8cc7\u6599\uff0c\u4f46\u9019\u6642\u5b9a\u6642\u4efb\u52d9\u9084\u6c92\u6709\u57f7\u884c\uff09\u3002 \u9019\u6642\uff0c\u5982\u679c\u525b\u597d\u4f60\u6b63\u4f7f\u7528yum\u5f9e\u8a72\u5c0d\u6620\u66f4\u65b0\uff0c\u5c31\u6703\u767c\u751fMetadata file does not match checksum\u7684\u554f\u984c\u4e86\u3002<br \/> \u6587\u4e2d\u63d0\u4f9b\u7684\u89e3\u6c7a\u65b9\u6cd5\u662f\uff0c\u6839\u64da\u5927\u90e8\u5206\u7684\u5c0d\u6620\u90fd\u662f\u6bcf\u5c0f\u6642\u9032\u884c\u4e00\u6b21\u8cc7\u6599\u540c\u6b65\u6216\u751f\u6210\u6821\u9a57\u8cc7\u6599\u7684\uff0c\u6240\u4ee5\uff0c\u4e0d\u8981\u9078\u53d6\u63a5\u8fd1\u6574\u9ede\u7684\u6642\u5019\u66f4\u65b0\u8cc7\u6599\uff0c\u800c\u61c9\u9078\u53d6\u6574\u9ede\u904e\u5f8c\u518d\u66f4\u65b0\u3002\u4f46\u9019\u53ea\u662f\u5efa\u8b70\uff0c\u4e0d\u80fd\u4fdd\u8b49\u4e00\u5b9a\u80fd\u89e3\u6c7a\u8a72\u554f\u984c\u3002<\/p>\n<p> \u53c3\u8003\u8a72\u6587\u7ae0\u7684\u5167\u5bb9\uff0c\u6211\u5011\u53ef\u4ee5\u770b\u770byum\u66f4\u65b0\u4e0b\u8f09\u7684\u8cc7\u6599\uff1a \/var\/cache\/yum\uff0c\u6839\u64da\u4f60\u5b9a\u7fa9\u7684repo.d\u6a94\u6848\u5167\u5bb9\uff0c\u6703\u5206\u958b\u591a\u5c64\u76ee\u9304\uff0c\u6bcf\u5c64\u4ee3\u8868\u4e00\u500b\u66f4\u65b0\u8def\u5f91\u3002<br \/> \u5f15\u7528<br \/> \u4f8b\u5982\uff1a\/var\/cache\/yum\/rpmforge<br \/> \u5176\u4e2d\uff0cprimary.xml.gz\u3001filelists.xml.gz\u3001\u548cother.xml.gz\u5c31\u662fmetadata\u8a0a\u606f\uff0c\u800crepomd.xml\u5c31\u662f\u6821\u9a57\u8cc7\u6599\u3002\u5176\u4f7f\u7528\u7684\u662fsha1\u9032\u884c\u6821\u9a57\u7684\u3002<\/p>\n<p> \u627e\u5230\u539f\u56e0\uff0c\u89e3\u6c7a\u5c31\u4e0d\u96e3\u4e86\u3002<\/p>\n<p> \u4e8c\u3001\u89e3\u6c7a<br \/> 1\u3001\u6e05\u7406\u5feb\u53d6<br \/> \u57f7\u884c\uff1a<br \/> # yum clean all<\/p>\n<p> \u5148\u628a\u5c31\u7684\u5feb\u53d6\u8cc7\u6599\u90fd\u53bb\u6389\u3002<\/p>\n<p> 2\u3001\u4e0b\u8f09metadata\u548c\u6821\u9a57\u8cc7\u6599<br \/> \u5148\u9032\u5165yum\u5c0d\u61c9\u7684\u76ee\u9304\uff0c\u518d\u4e0b\u8f09\uff1a<br \/> # cd \/var\/cache\/yum\/rpmforge<br \/> # wget &#8211;cache=off http:\/\/apt.sw.be\/redhat\/el4\/en\/i386\/dag\/repodata\/repomd.xml<br \/> # wget &#8211;cache=off http:\/\/apt.sw.be\/redhat\/el4\/en\/i386\/dag\/repodata\/primary.xml.gz<br \/> # wget &#8211;cache=off http:\/\/apt.sw.be\/redhat\/el4\/en\/i386\/dag\/repodata\/filelists.xml.gz<br \/> # wget &#8211;cache=off http:\/\/apt.sw.be\/redhat\/el4\/en\/i386\/dag\/repodata\/other.xml.gz<\/p>\n<p> 3\u3001\u6821\u9a57\u8cc7\u6599<br \/> \u57f7\u884c\uff1a<br \/> \u5f15\u7528<br \/> # sha1sum other.xml.gz filelists.xml.gz primary.xml.gz<br \/> 74fcc9f9e218cfdbc1ac2b5ac17ff7d912267bdf&nbsp; other.xml.gz<br \/> 3f4b2e9a5efc67c0cdf329c69f041daa82a2346c&nbsp; filelists.xml.gz<br \/> bd2033e1fd7a7d1f1b92ce7b880919bd685217f8&nbsp; primary.xml.gz<\/p>\n<p> \u5c0d\u7167repomd.xml\u4e2d\u7684\u8a0a\u606f\uff1a<br \/> \u5f15\u7528<br \/> # cat repomd.xml |grep -w &#39;checksum&#39;|grep -v &#39;open-checksum&#39;<br \/> &nbsp;&nbsp; &lt;checksum type=&quot;sha&quot;&gt;74fcc9f9e218cfdbc1ac2b5ac17ff7d912267bdf&lt;\/checksum&gt;<br \/> &nbsp;&nbsp; &lt;checksum type=&quot;sha&quot;&gt;3f4b2e9a5efc67c0cdf329c69f041daa82a2346c&lt;\/checksum&gt;<br \/> &nbsp;&nbsp; &lt;checksum type=&quot;sha&quot;&gt;bd2033e1fd7a7d1f1b92ce7b880919bd685217f8&lt;\/checksum&gt;<\/p>\n<p> \u82e5\u8cc7\u6599\u6b63\u78ba\uff0c\u5247\u8aaa\u660emetadata\u548c\u6821\u9a57\u8cc7\u6599\u662f\u7b26\u5408\u7684\u3002\u53ef\u4ee5\u4f7f\u7528yum\u66f4\u65b0\u4e86\uff0c\u4e0d\u6703\u518d\u91cd\u65b0\u4e0b\u8f09metadata\u3002<br \/> \u5426\u5247\uff0c\u53ef\u4ee5\u518d\u7b49\u5f85\u4e00\u4e0b\uff0c\u6216\u9700\u8981\u5f9e\u5176\u4ed6\u7684\u5c0d\u6620\u53d6\u5f97\u66f4\u65b0\u54af\u3002<\/p>\n<p> \u4e09\u3001\u5efa\u8b70<br \/> \u56e0\u70ba\u6211\u5011\u4e0d\u80fd\u63a7\u5236\u5c0d\u6620\u66f4\u65b0\u7684\u901f\u5ea6\u548c\u6642\u9593\uff0c\u800c\u6211\u5011\u7684\u5de5\u4f5c\u53ea\u662f\u907f\u514d\u4e86yum\u53ef\u80fd\u767c\u751f\u8aa4\u5224\u7684\u60c5\u6cc1\uff0c\u4f46\u4e26\u4e0d\u80fd\u5b8c\u5168\u4fdd\u8b49\u4e0a\u9762\u7684\u5de5\u4f5c\u662f\u5b8c\u6210\u7684\u3002<br \/> \u5f9e\u76e1\u53ef\u80fd\u907f\u514d\u8a72\u554f\u984c\u7684\u89d2\u5ea6\u51fa\u767c\uff0c\u6709\u5e7e\u500b\u5efa\u8b70\uff1a<br \/> 1\u3001\u9078\u53d6\u597d\u7684\u5c0d\u6620<br \/> \u8a2d\u5b9ayum.repos.d\u4e2dbaseurl\u6216mirrorlist\u5f9e\u597d\u7684\u5c0d\u6620\u4e0b\u8f09\u3002\u82e5\u77e5\u9053\u67d0\u500b\u5c0d\u6620\u901f\u5ea6\u5feb\uff0c\u5247\u4e7e\u8106\u7528baseurl\u56fa\u5b9a\uff0c\u800c\u4e0d\u8981\u4f7f\u7528mirrorlist\u4e86\u3002<\/p>\n<p> 2\u3001\u6392\u67e5\u7db2\u8def\u554f\u984c<br \/> \u7db2\u4e0a\u63d0\u4f9b\u7684\u65b9\u6cd5\u5927\u90e8\u5206\u662f\u8f49\u8f09\u9019\u88e1\u7684\u3002\u5176\u5efa\u8b70\u4f7f\u7528&#8211;cache=off\u53c3\u6578\uff08\u8868\u793a\u4e0d\u4f7f\u7528\u4f3a\u670d\u5668\u4e2d\u7684\u9ad8\u901f\u5feb\u53d6\u4e2d\u7684\u8cc7\u6599\uff09\u3002<br \/> \u4f46\u5be6\u969b\u4e0a\uff0c\u6211\u767c\u73fe\u9664\u975e\u7db2\u8def\u6709\u554f\u984c\uff0c\u5426\u5247\u662f\u5426\u4f7f\u7528\u8a72\u53c3\u6578\u62ff\u56de\u4f86\u7684\u8cc7\u6599\u4e0d\u61c9\u8a72\u6709\u6709\u5340\u5225\u7684\u3002<br \/> \u5982\uff1a<br \/> \u5f15\u7528<br \/> # sha1sum primary.xml.gz*<br \/> bd2033e1fd7a7d1f1b92ce7b880919bd685217f8&nbsp; primary.xml.gz<br \/> bd2033e1fd7a7d1f1b92ce7b880919bd685217f8&nbsp; primary.xml.gz.1<\/p>\n<p> \u203bprimary.xml.gz\u662f\u4f7f\u7528&#8211;cache=off\u53c3\u6578\u7684\uff0c\u800cprimary.xml.gz.1\u662f\u6c92\u6709\u4f7f\u7528\u8a72\u53c3\u6578\u7684\u3002<br \/> \u6240\u4ee5\uff0c\u5982\u679c\u7db2\u8def\u51fa\u73fe\u554f\u984c\uff0c\u662f\u6703\u5f71\u97ff\u5230yum\u4e0b\u8f09\u8cc7\u6599\u7684\u5b8c\u6574\u6027\u7684\u3002\u800c\u4f7f\u7528&#8211;cache=off\u65e2\u7136\u6c92\u58de\uff0c\u4e0d\u59a8\u4f7f\u7528\u54af\u3002<\/strong><\/p>\n","protected":false},"excerpt":{"rendered":"<p>&nbsp;\u89e3\u6c7aMetadata file does not match checksum\u932f\u8aa4 \u5728\u4f7f\u7528yum\u66f4 [&hellip;]<\/p>\n","protected":false},"author":1,"featured_media":487,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[7],"tags":[20],"class_list":["post-105","post","type-post","status-publish","format-standard","has-post-thumbnail","hentry","category-linux","tag-linux"],"_links":{"self":[{"href":"https:\/\/por.tw\/linux\/wp-json\/wp\/v2\/posts\/105"}],"collection":[{"href":"https:\/\/por.tw\/linux\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/por.tw\/linux\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/por.tw\/linux\/wp-json\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/por.tw\/linux\/wp-json\/wp\/v2\/comments?post=105"}],"version-history":[{"count":0,"href":"https:\/\/por.tw\/linux\/wp-json\/wp\/v2\/posts\/105\/revisions"}],"wp:featuredmedia":[{"embeddable":true,"href":"https:\/\/por.tw\/linux\/wp-json\/wp\/v2\/media\/487"}],"wp:attachment":[{"href":"https:\/\/por.tw\/linux\/wp-json\/wp\/v2\/media?parent=105"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/por.tw\/linux\/wp-json\/wp\/v2\/categories?post=105"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/por.tw\/linux\/wp-json\/wp\/v2\/tags?post=105"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}