{"id":232,"date":"2024-06-29T02:28:44","date_gmt":"2024-06-28T18:28:44","guid":{"rendered":"http:\/\/www.chan.ink\/?p=232"},"modified":"2024-07-26T15:32:54","modified_gmt":"2024-07-26T07:32:54","slug":"%e5%b0%8f%e8%ae%b0%e5%bd%95","status":"publish","type":"post","link":"http:\/\/www.chan.ink\/index.php\/2024\/06\/29\/%e5%b0%8f%e8%ae%b0%e5%bd%95\/","title":{"rendered":"\u5c0f\u8bb0\u5f55"},"content":{"rendered":"\n<p class=\"wp-block-paragraph\">\u6700\u8fd1\u770b\u5b8c\u4e86head first python\uff0c\u867d\u7136\u8ddf\u7740\u6559\u7a0b\uff0c\u5728\u4e66\u4e2d\u6307\u5b9a\u7684\u7f51\u7ad9\u505a\u4e86\u4e00\u4e2a\u7ebf\u4e0a\u53ef\u8bbf\u95ee\u7684\u94fe\u63a5\u3002\u4f46\u662f\u8fd8\u662f\u50cf\u81ea\u5df1\u5b66\u4f1a\u5728\u4efb\u4f55liunx\u73af\u5883\u4e0b\u90e8\u7f72python\u9879\u76ee\u3002<\/p>\n\n\n\n<p class=\"wp-block-paragraph\">\u4e00\u5f00\u59cb\u770b\u4e86\u7528\u5b9d\u5854\uff0c\u4f46\u662f\u4e2d\u9014\u64cd\u4f5c\u6709\u8bef\uff0c\u800c\u4e14\u7c7b\u4f3c\u7684\u6559\u7a0b\u5f88\u5c11\uff0c\u60f3\u60f3\u8fd8\u662f\u4ece\u6700\u5e95\u5c42\u7684linux\u73af\u5883\u4e0b\u5b66\u4f1a\u914d\u7f6e\u5427\u3002<\/p>\n\n\n\n<p class=\"wp-block-paragraph\"><\/p>\n\n\n\n<p class=\"wp-block-paragraph\">\u4e8e\u662f\u5728\u963f\u91cc\u4e91\u670d\u52a1\u5668\u4e0a\u9762\u914d\u7f6e\u8d77\u6765\u4e86\uff0c\u4f46\u662f\u5916\u7f51\u8fd8\u662f\u6ca1\u6cd5\u76f4\u63a5\u8bbf\u95ee\uff0c\u5e94\u8be5\u662f\u670d\u52a1\u5668\u6ca1\u6709\u5907\u6848\u7684\u539f\u56e0\u3002\u4e8e\u662f\u4e4e\uff0c\u7528\u4e00\u53f0\u4ee5\u524d\u4e70\u7684\u7eff\u4e91\u670d\u52a1\u5668\u6765\u64cd\u4f5c\u3002\u4e8e\u662f\u91cd\u88c5\u4e86\u7cfb\u7edf\u3002<\/p>\n\n\n\n<p class=\"wp-block-paragraph\">\u505a\u7a0b\u5e8f\u5458\u5c31\u662f\u6709\u5f88\u591a\u4e4c\u4e03\u516b\u7cdf\u7684\u7834\u4e8b\u5427\uff0c\u56e0\u4e3a\u7eff\u4e91\u670d\u52a1\u5668\u5546\u5bb6\u53ea\u63d0\u4f9bcentos8\uff0c\u4f46\u662fcentos8\u57282021\u5e74\u5c31\u505c\u6b62\u4e86\u670d\u52a1\uff0c\u5728\u64cd\u4f5c\u8fc7\u7a0b\u4e2d\u6709\u4e00\u4e9b\u95ee\u9898\uff0c\u53ea\u80fd\u6c42\u52a9\u4e8e\u4ed6\u4eec\u5bb6\u7684\u5ba2\u670d\uff0c\u597d\u5728\u4e09\u54e5\u56de\u590d\u53ca\u65f6\uff0c\u5904\u7406\u9ad8\u6548\u3002\u770b\u6765\u7eff\u4e91\u8fd8\u662f\u53ef\u4ee5\u7eed\u8d39\u7684\u3002<\/p>\n\n\n\n<figure class=\"wp-block-image size-full\"><img loading=\"lazy\" decoding=\"async\" width=\"688\" height=\"1641\" src=\"http:\/\/www.chan.ink\/wp-content\/uploads\/2024\/06\/WS9N8PQISBR8HYHNIRLB.png\" alt=\"\" class=\"wp-image-233\"\/><\/figure>\n\n\n\n<p class=\"wp-block-paragraph\">\u5c31\u662f\u53ef\u7b11\u6211\u7684\u82f1\u8bed\u6c34\u5e73\u8ddf\u73b0\u5728\u7684\u7f16\u7a0b\u6c34\u5e73\u4e00\u6837\u8e69\u811a\u54c8\u54c8\u54c8\u3002<\/p>\n\n\n\n<p class=\"wp-block-paragraph\">\u8fd9\u662f\u5ba2\u670d\u7ed9\u51fa\u7684\u89e3\u51b3\u65b9\u6848\uff1a<a href=\"https:\/\/green.cloud\/docs\/how-to-fix-update-failed-on-linux\/\">https:\/\/green.cloud\/docs\/how-to-fix-update-failed-on-linux\/<\/a><\/p>\n\n\n\n<p class=\"wp-block-paragraph\"><\/p>\n\n\n\n<hr class=\"wp-block-separator has-alpha-channel-opacity\"\/>\n\n\n\n<h1 class=\"wp-block-heading\">How to fix update failed on Linux<\/h1>\n\n\n\n<p class=\"wp-block-paragraph\">Estimated reading: 3 minutes&nbsp;148 views<\/p>\n\n\n\n<p class=\"wp-block-paragraph\">In this article, you will learn how to fix some common update errors that occur frequently when you try to update on the Linux operating system. Below are 3 error cases encountered when we run updates on our Almalinux, Centos, and Debian 12 versions.<\/p>\n\n\n\n<figure class=\"wp-block-embed is-type-rich\"><div class=\"wp-block-embed__wrapper\">\nhttps:\/\/youtube.com\/watch?v=CTRuDWDJkkE%3Ffeature%3Doembed\n<\/div><\/figure>\n\n\n\n<h3 class=\"wp-block-heading\" id=\"1-\u201cerror-failed-to-download-metadata-for-repo-\u2018appstream\u2019-cannot\">1. \u201c<strong>Error: Failed to download metadata for repo \u2018appstream\u2019: Cannot prepare internal mirrorlist: No URLs in mirrorlist<\/strong>\u201d<a href=\"https:\/\/green.cloud\/docs\/how-to-fix-update-failed-on-linux\/#1-%E2%80%9Cerror-failed-to-download-metadata-for-repo-%E2%80%98appstream%E2%80%99-cannot\"><\/a><\/h3>\n\n\n\n<p class=\"wp-block-paragraph\">If you, for one reason or the other, are still actively using&nbsp;<strong>CentOS 8<\/strong>, you might probably have encountered the following error when trying to update your system or simply install a package.<\/p>\n\n\n\n<p class=\"wp-block-paragraph\">For example, in the screenshot that follows, I was trying run update&nbsp; and ran into it.<\/p>\n\n\n\n<figure class=\"wp-block-image\"><img decoding=\"async\" src=\"https:\/\/green.cloud\/docs\/wp-content\/uploads\/2024\/06\/nw14-1024x80.png\" alt=\"\" class=\"wp-image-28359\"\/><\/figure>\n\n\n\n<h5 class=\"wp-block-heading\">What is the Cause of This Error?<\/h5>\n\n\n\n<p class=\"wp-block-paragraph\">You may well be aware that&nbsp;<strong>CentOS Linux 8<\/strong>&nbsp;died a premature death, it reached the End Of Life (EOL) on December 31st, 2021, thus it no longer receives development resources from the official CentOS project.<\/p>\n\n\n\n<p class=\"wp-block-paragraph\">This means that after Dec 31st, 2021, to update your CentOS installation, you are required to change the mirrors to&nbsp;CentOS Vault Mirror, where they will be archived permanently.<\/p>\n\n\n\n<h5 class=\"wp-block-heading\" id=\"h_01HAMMP99XZ6BXNEK5JHQ5RG2B\">Solution<\/h5>\n\n\n\n<p class=\"wp-block-paragraph\">To fix the above error, open your terminal or login via SSH, and run the following commands to change the repo URL to point to&nbsp;<strong>vault.centos.org<\/strong>, from the official CentOS repos.<\/p>\n\n\n\n<p class=\"wp-block-paragraph\">Here we use the&nbsp;<strong>sed<\/strong>&nbsp;command to edit the required directives or parameters in the repo configuration files:<\/p>\n\n\n\n<pre class=\"wp-block-preformatted\"># sed -i 's\/mirrorlist\/#mirrorlist\/g' \/etc\/yum.repos.d\/CentOS-*\n# sed -i 's|#baseurl=http:\/\/mirror.centos.org|baseurl=http:\/\/vault.centos.org|g' \/etc\/yum.repos.d\/CentOS-*<\/pre>\n\n\n\n<p class=\"wp-block-paragraph\">Alternatively, you can also point to the Cloudflare-based vault repository, by running the following commands:<\/p>\n\n\n\n<pre class=\"wp-block-preformatted\"># sed -i 's\/mirrorlist\/#mirrorlist\/g' \/etc\/yum.repos.d\/CentOS-Linux-*\n# sed -i 's|#baseurl=http:\/\/mirror.centos.org|baseurl=http:\/\/vault.epel.cloud|g' \/etc\/yum.repos.d\/CentOS-Linux-*<\/pre>\n\n\n\n<p class=\"wp-block-paragraph\">Now you should be able to update&nbsp;<strong>CentOS<\/strong>&nbsp;or install packages without any error<\/p>\n\n\n\n<figure class=\"wp-block-image\"><img decoding=\"async\" src=\"https:\/\/green.cloud\/docs\/wp-content\/uploads\/2024\/06\/nw16-1024x187.png\" alt=\"\" class=\"wp-image-28361\"\/><\/figure>\n\n\n\n<h3 class=\"wp-block-heading\" id=\"2-error-gpg-check-failed\">2. Error: GPG check FAILED<a href=\"https:\/\/green.cloud\/docs\/how-to-fix-update-failed-on-linux\/#2-error-gpg-check-failed\"><\/a><\/h3>\n\n\n\n<p class=\"wp-block-paragraph\">When installing packages on AlmaLinux, if you run into a \u201cGPG check failed\u201d problem, it means that the available GPG keys were unable to verify the signature of the package. A corrupt repository, an out-of-date or missing GPG key, or network problems could all be the cause of this.<\/p>\n\n\n\n<figure class=\"wp-block-image\"><img decoding=\"async\" src=\"https:\/\/green.cloud\/docs\/wp-content\/uploads\/2024\/06\/nw17-1024x161.png\" alt=\"\" class=\"wp-image-28363\"\/><\/figure>\n\n\n\n<h5 class=\"wp-block-heading\" id=\"h_01HAMMP99X5YRZ1CFMW7ZERF83\">Cause<\/h5>\n\n\n\n<p class=\"wp-block-paragraph\">The GPG key for the xfsdump package was not installed, resulting in a GPG check failure during the package installation, which was resolved by importing the necessary key from the AlmaLinux repository.<\/p>\n\n\n\n<p class=\"wp-block-paragraph\">cloudlinux-release-8.9-2.el8 package contains an updated AlmaLinux key, but won\u2019t help with current systems<\/p>\n\n\n\n<h5 class=\"wp-block-heading\" id=\"h_01HAMMP99XZ6BXNEK5JHQ5RG2B\">Solution<\/h5>\n\n\n\n<p class=\"wp-block-paragraph\">Update the GPG keys that we use to verify packages. Importing the most recent GPG keys from the repository will enable us to perform this. So, we can run the following command:<\/p>\n\n\n\n<pre class=\"wp-block-preformatted\"># rpm --import https:\/\/repo.almalinux.org\/almalinux\/RPM-GPG-KEY-AlmaLinux<\/pre>\n\n\n\n<p class=\"wp-block-paragraph\">Now you should be able to update Almalinux&nbsp;or install packages without any error:<\/p>\n\n\n\n<h3 class=\"wp-block-heading\" id=\"3-error-sub-process-\u2013-apt-listchanges\">3. Error: sub-process \u2013 apt-listchanges<a href=\"https:\/\/green.cloud\/docs\/how-to-fix-update-failed-on-linux\/#3-error-sub-process-%E2%80%93-apt-listchanges\"><\/a><\/h3>\n\n\n\n<p class=\"wp-block-paragraph\">I keep on getting this error when I try to install or upgrade on Debian 12 and almost everything.<\/p>\n\n\n\n<figure class=\"wp-block-image\"><img decoding=\"async\" src=\"https:\/\/green.cloud\/docs\/wp-content\/uploads\/2024\/06\/image-eror2-1024x107.png\" alt=\"\" class=\"wp-image-29047\"\/><\/figure>\n\n\n\n<h5 class=\"wp-block-heading\" id=\"h_01HAMMP99XZ6BXNEK5JHQ5RG2B\">Solution<\/h5>\n\n\n\n<p class=\"wp-block-paragraph\">You can fix the error by running the following command<\/p>\n\n\n\n<pre class=\"wp-block-code\"><code># mv \/etc\/apt\/apt.conf.d\/20listchanges \/etc\/apt\/apt.conf.d\/20listchanges.bak<\/code><\/pre>\n\n\n\n<h3 class=\"wp-block-heading\" id=\"4-error-the-repository-cdrom-does-not-have-a-release-file\u201d\">4. Error: The repository cdrom does not have a release file\u201d<a href=\"https:\/\/green.cloud\/docs\/how-to-fix-update-failed-on-linux\/#4-error-the-repository-cdrom-does-not-have-a-release-file%E2%80%9D\"><\/a><\/h3>\n\n\n\n<p class=\"wp-block-paragraph\">You can see detailed error correction here:&nbsp;<a href=\"https:\/\/green.cloud\/docs\/how-to-fix-the-repository-cdrom-does-not-have-a-release-file-error-on-debian-12\/\">How to fix \u201cthe repository cdrom does not have a release file\u201d error on Debian 12<\/a><\/p>\n\n\n\n<h3 class=\"wp-block-heading\" id=\"conclusion\">Conclusion<a href=\"https:\/\/green.cloud\/docs\/how-to-fix-update-failed-on-linux\/#conclusion\"><\/a><\/h3>\n\n\n\n<p class=\"wp-block-paragraph\">And there you have it! A comprehensive guide to fixing the update errors in Linux versions. Trust me, I\u2019ve faced this error more times than I can count and these steps have helped me every single time.<\/p>\n\n\n\n<p class=\"wp-block-paragraph\">Good Luck!<\/p>\n","protected":false},"excerpt":{"rendered":"<p>\u6700\u8fd1\u770b\u5b8c\u4e86head first python\uff0c\u867d\u7136\u8ddf\u7740\u6559\u7a0b\uff0c\u5728\u4e66\u4e2d\u6307\u5b9a\u7684\u7f51\u7ad9\u505a\u4e86\u4e00\u4e2a\u7ebf\u4e0a\u53ef\u8bbf\u95ee\u7684\u94fe\u63a5\u3002\u4f46\u662f\u8fd8\u662f [&hellip;]<\/p>\n","protected":false},"author":1,"featured_media":0,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[1],"tags":[],"class_list":["post-232","post","type-post","status-publish","format-standard","hentry","category-uncategorized"],"_links":{"self":[{"href":"http:\/\/www.chan.ink\/index.php\/wp-json\/wp\/v2\/posts\/232","targetHints":{"allow":["GET"]}}],"collection":[{"href":"http:\/\/www.chan.ink\/index.php\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"http:\/\/www.chan.ink\/index.php\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"http:\/\/www.chan.ink\/index.php\/wp-json\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"http:\/\/www.chan.ink\/index.php\/wp-json\/wp\/v2\/comments?post=232"}],"version-history":[{"count":3,"href":"http:\/\/www.chan.ink\/index.php\/wp-json\/wp\/v2\/posts\/232\/revisions"}],"predecessor-version":[{"id":312,"href":"http:\/\/www.chan.ink\/index.php\/wp-json\/wp\/v2\/posts\/232\/revisions\/312"}],"wp:attachment":[{"href":"http:\/\/www.chan.ink\/index.php\/wp-json\/wp\/v2\/media?parent=232"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"http:\/\/www.chan.ink\/index.php\/wp-json\/wp\/v2\/categories?post=232"},{"taxonomy":"post_tag","embeddable":true,"href":"http:\/\/www.chan.ink\/index.php\/wp-json\/wp\/v2\/tags?post=232"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}