{"id":392,"date":"2024-02-01T14:53:58","date_gmt":"2024-02-01T06:53:58","guid":{"rendered":"http:\/\/www.x4s.cn\/?p=392"},"modified":"2024-02-01T16:02:02","modified_gmt":"2024-02-01T08:02:02","slug":"centos8-2-%e6%ba%90%e5%a4%b1%e6%95%88%e5%8f%8a%e6%b7%bb%e5%8a%a0%e4%b8%ad%e6%96%87%e8%af%ad%e8%a8%80%e5%8c%85%e7%ad%89%e5%b8%b8%e8%a7%81%e9%97%ae%e9%a2%98","status":"publish","type":"post","link":"http:\/\/www.x4s.cn\/?p=392","title":{"rendered":"CentOS8.2 \u6e90\u5931\u6548\u53ca\u6dfb\u52a0\u4e2d\u6587\u8bed\u8a00\u5305\u7b49\u5e38\u89c1\u95ee\u9898"},"content":{"rendered":"\n<figure class=\"wp-block-image size-full\"><img loading=\"lazy\" decoding=\"async\" width=\"460\" height=\"280\" src=\"http:\/\/www.x4s.cn\/wp-content\/uploads\/2024\/02\/image.png\" alt=\"\" class=\"wp-image-393\" srcset=\"http:\/\/www.x4s.cn\/wp-content\/uploads\/2024\/02\/image.png 460w, http:\/\/www.x4s.cn\/wp-content\/uploads\/2024\/02\/image-300x183.png 300w\" sizes=\"auto, (max-width: 460px) 100vw, 460px\" \/><\/figure>\n\n\n\n<p class=\"has-medium-font-size wp-block-paragraph\"><br><strong>Error: Failed to download metadata for repo &#8216;appstream&#8217;: Cannot prepare internal mirrorlist: No URLs in mirrorlist<\/strong><\/p>\n\n\n\n<p class=\"has-small-font-size wp-block-paragraph\">\u4e0a\u9762\u7684\u62a5\u9519\u4fe1\u606f\u610f\u601d\u662f\uff0c\u4ece\u4ed3\u5e93 \u2018appstream\u2019 \u4e0b\u8f7d\u5143\u6570\u636e\u5931\u8d25\uff1a\u7531\u4e8e\u955c\u50cf\u5217\u8868\u4e2d\u6ca1\u6709 URL\uff0c\u4e0d\u80fd\u51c6\u5907\u5185\u90e8\u955c\u50cf\u5217\u8868\u3002<br><strong>\u95ee\u9898\u5206\u6790\uff1a<\/strong><br>\u7b2c\u4e00\u79cd\u53ef\u80fd\u7684\u60c5\u51b5\u4fbf\u662f\u7f51\u7edc\u8fde\u63a5\u95ee\u9898\u3002\u68c0\u67e5\u662f\u5426\u53ef\u4ee5\u8fde\u63a5\u5916\u90e8\u7f51\u7edc\uff0c\u53ef\u4ee5\u4f7f\u7528 ping baidu.com \u67e5\u770b\u662f\u5426\u6709\u4e22\u5305\u60c5\u51b5\u3002\u5982\u679c\u4e22\u5305\uff0c\u5219\u8fdb\u4e00\u6b65\u68c0\u67e5\u7f51\u7edc\u8fde\u63a5\u662f\u5426\u6b63\u5e38\uff1b\u5982\u679c\u6ca1\u6709\u4e22\u5305\uff0c\u7ee7\u7eed\u9605\u8bfb\u4e0b\u6587\u2728\u90a3\u4e48\u7b2c\u4e8c\u79cd\u60c5\u51b5\uff0c\u4fbf\u662f CentOS \u5df2\u7ecf\u505c\u6b62\u7ef4\u62a4\u7684\u95ee\u9898\u30022020 \u5e74 12 \u6708 8 \u53f7\uff0cCentOS \u5b98\u65b9\u5ba3\u5e03\u4e86\u505c\u6b62\u7ef4\u62a4 CentOS Linux \u7684\u8ba1\u5212\uff0c\u5e76\u63a8\u51fa\u4e86 CentOS Stream \u9879\u76ee\uff0cCentOS Linux 8 \u4f5c\u4e3a RHEL 8 \u7684\u590d\u523b\u7248\u672c\uff0c\u751f\u547d\u5468\u671f\u7f29\u77ed\uff0c\u4e8e 2021 \u5e74 12 \u6708 31 \u65e5\u505c\u6b62\u66f4\u65b0\u5e76\u505c\u6b62\u7ef4\u62a4\uff08EOL\uff09\uff0c\u66f4\u591a\u7684\u4fe1\u606f\u53ef\u4ee5\u67e5\u770b CentOS \u5b98\u65b9\u516c\u544a\u3002\u5982\u679c\u9700\u8981\u66f4\u65b0 CentOS\uff0c\u9700\u8981\u5c06\u955c\u50cf\u4ece mirror.centos.org \u66f4\u6539\u4e3a vault.centos.org<br>\u90a3\u4e48\u9488\u5bf9\u4e0a\u9762\u63d0\u5230\u7684\u7b2c\u4e8c\u79cd\u60c5\u51b5\uff0c\u7ed9\u51fa\u7684\u89e3\u51b3\u65b9\u6cd5\u5982\u4e0b\uff1a<br> \u9996\u5148\uff0c\u8fdb\u5165\u5230 yum \u7684 repos \u76ee\u5f55<br>          <code>cd \/etc\/yum.repos.d\/<\/code><br>\u5176\u6b21\uff0c\u4fee\u6539 centos \u6587\u4ef6\u5185\u5bb9<br>            <code>sed -i 's\/mirrorlist\/#mirrorlist\/g' \/etc\/yum.repos.d\/CentOS-*<\/code><br>            <code>sed -i 's|#baseurl=http:\/\/mirror.centos.org|baseurl=http:\/\/vault.centos.org|g' \/etc\/yum.repos.d\/CentOS-* <\/code><br> \u7136\u540e\uff0c\u751f\u6210\u7f13\u5b58\u66f4\u65b0\uff08\u7b2c\u4e00\u6b21\u66f4\u65b0\uff0c\u901f\u5ea6\u7a0d\u5fae\u6709\u70b9\u6162\uff0c\u8010\u5fc3\u7b49\u5f85 2min \u5de6\u53f3\uff09<br>            <code>yum makecache <\/code><br><\/p>\n\n\n\n<h2 class=\"wp-block-heading\">Failed to set locale, defaulting to C.UTF-8<\/h2>\n\n\n\n<ul class=\"wp-block-list\">\n<li class=\"has-small-font-size\">CentOS 8\u4e2d\u6267\u884c<code>\u547d\u4ee4<\/code>\uff0c\u51fa\u73b0\u62a5\u9519\uff1aFailed to set locale, defaulting to C.UTF-8<\/li>\n\n\n\n<li class=\"has-small-font-size\">\u62a5\u9519\u539f\u56e0\uff1a\n<ul class=\"wp-block-list\">\n<li>1\u3001\u6ca1\u6709\u5b89\u88c5\u76f8\u5e94\u7684\u8bed\u8a00\u5305\u3002<\/li>\n\n\n\n<li>2\u3001\u6ca1\u6709\u8bbe\u7f6e\u6b63\u786e\u7684\u8bed\u8a00\u73af\u5883\u3002<\/li>\n<\/ul>\n<\/li>\n<\/ul>\n\n\n\n<ul class=\"wp-block-list\">\n<li class=\"has-small-font-size\"><strong>\u89e3\u51b3\u65b9\u6cd51\uff1a\u5b89\u88c5\u8bed\u8a00\u5305<\/strong>\n<ul class=\"wp-block-list\">\n<li class=\"has-small-font-size\">\u8bbe\u7f6e\u8bed\u8a00\u73af\u5883\u9700\u4f7f\u7528\u547d\u4ee4&nbsp;locale<\/li>\n\n\n\n<li class=\"has-small-font-size\"><code>locale -a \u547d\u4ee4\uff0c<\/code>\u67e5\u770b\u76ee\u524d\u7cfb\u7edf\u5df2\u5b89\u88c5\u7684\u8bed\u8a00\u5305<\/li>\n\n\n\n<li class=\"has-small-font-size\">\u5b89\u88c5\u4e2d\u6587\u8bed\u8a00\u5305\uff0c\u547d\u4ee4<code>yum install glibc-langpack-zh<\/code><\/li>\n\n\n\n<li class=\"has-small-font-size\"><code>\u5b89\u88c5\u82f1\u6587\u8bed\u8a00\u5305\uff0c\u547d\u4ee4 dnf install glibc-langpack-en<\/code>&nbsp;\u6216&nbsp;<code>dnf install langpacks-en glibc-all-langpacks -y<\/code><\/li>\n<\/ul>\n<\/li>\n<\/ul>\n\n\n\n<ul class=\"wp-block-list\">\n<li class=\"has-small-font-size\"><strong>\u89e3\u51b3\u65b9\u6cd52\uff1a\u8bbe\u7f6e\u6b63\u786e\u7684\u8bed\u8a00\u73af\u5883<\/strong><br>     <code>echo \"export LC_ALL=en_US.UTF-8\" &gt;&gt; \/etc\/profilesource \/etc\/profile<\/code><br>\u4f7f\u7528\u547d\u4ee4\u4fee\u6539\u7f16\u7801\uff1a<br>    <code>locale -gen en_US.UTF-8<\/code><br>\u4f7f\u7528vi\u7f16\u8f91\u5668\u4fee\u6539\u7f16\u7801\u4e3aUTF-8\uff0c\u4f60\u9700\u8981\u8fdb\u884c\u4ee5\u4e0b\u6b65\u9aa4\uff1a<br>     1.\u7f16\u8f91locale\u914d\u7f6e\u6587\u4ef6\uff1a<br>           sudo vi \/etc\/locale.conf<br>       \u5728\u6253\u5f00\u7684\u6587\u4ef6\u4e2d\uff0c\u6dfb\u52a0\u6216\u7f16\u8f91\u4ee5\u4e0b\u884c\u6765\u8bbe\u7f6e\u7f16\u7801\u4e3aUTF-8\uff1a<br>           LANG=en_US.UTF-8 LC_ALL=en_US.UTF-8<br>     2.\u4fdd\u5b58\u5e76\u5173\u95ed\u6587\u4ef6\u3002 4.\u7f16\u8f91\u7cfb\u7edf\u914d\u7f6e\u6587\u4ef6\/etc\/environment\uff1a<br>           sudo vi \/etc\/environment <br>        \u5728\u6587\u4ef6\u4e2d\u6dfb\u52a0\u4ee5\u4e0b\u884c\u6765\u8bbe\u7f6e\u7f16\u7801\u4e3aUTF-8\uff1a<br>           LANG=en_US.UTF-8    LC_ALL=en_US.UTF-8<\/li>\n\n\n\n<li><strong>\u7cfb\u7edf\u66f4\u65b0<\/strong><br>      <code>yum update -y<\/code><br><\/li>\n\n\n\n<li class=\"has-medium-font-size\"><strong>\u5b9d\u5854\u4f01\u4e1a\u72488.0.2\u5b89\u88c5<\/strong>\n<ul class=\"wp-block-list\">\n<li class=\"has-small-font-size\">   \u548c\u8c10\u7248BT\u9762\u677f\u5b89\u88c5\uff1a <br>       <code>yum install -y wget &amp;&amp; wget -O install.sh http:\/\/io.bt.sy\/install\/install_6.0.sh &amp;&amp; sh install.sh<\/code><br>   \u66f4\u65b0BT\u9762\u677f\u5230\u5f53\u524d\u6700\u65b0\u7248\uff1a<br>      <code>curl https:\/\/io.bt.sy\/install\/update_panel.sh|bash<\/code><\/li>\n<\/ul>\n<\/li>\n\n\n\n<li class=\"has-medium-font-size\"><strong>\u540c\u6b65\u65f6\u95f4(\u963f\u91cc\u4e91NTP\u670d\u52a1\u4e3a\u4f8b)<\/strong><\/li>\n\n\n\n<li class=\"has-small-font-size\">\u4e00\u3001\u5b89\u88c5chrony<\/li>\n\n\n\n<li class=\"has-small-font-size\">sudo dnf install chrony<\/li>\n\n\n\n<li class=\"has-small-font-size\">\u4e8c\u3001\u4f7f\u7528 sed \u547d\u4ee4\u4e00\u952e\u5b8c\u6210\u914d\u7f6e<\/li>\n\n\n\n<li class=\"has-small-font-size\">pool 2.centos.pool.ntp.org iburst\u7ed9\u8fd9\u4e00\u884c\u52a0\u6ce8\u91ca<\/li>\n\n\n\n<li class=\"has-small-font-size\">sudo sed -i &#8216;s\/^pool 2.centos.pool.ntp.org iburst\/#&amp;\/&#8217; \/etc\/chrony.conf<\/li>\n\n\n\n<li class=\"has-small-font-size\">\u6dfb\u52a03\u4e2a\u963f\u91cc\u4e91NTP\u670d\u52a1\u5668<\/li>\n\n\n\n<li class=\"has-small-font-size\">echo -e &#8220;server ntp1.aliyun.com iburst\\nserver ntp2.aliyun.com iburst\\nserver ntp3.aliyun.com iburst&#8221; | sudo tee -a \/etc\/chrony.conf<\/li>\n\n\n\n<li class=\"has-small-font-size\">\u4e09\u3001\u91cd\u542f chronyd \u670d\u52a1\u4ee5\u5e94\u7528\u66f4\u6539<\/li>\n\n\n\n<li class=\"has-small-font-size\">sudo systemctl restart chronyd<\/li>\n\n\n\n<li class=\"has-small-font-size\">\u56db\u3001\u8bbe\u7f6e\u5f00\u673a\u81ea\u542f<\/li>\n\n\n\n<li class=\"has-small-font-size\">sudo systemctl enable chronyd<\/li>\n\n\n\n<li class=\"has-small-font-size\">\u4e94\u3001\u68c0\u67e5 NTP \u540c\u6b65\u72b6\u6001<\/li>\n\n\n\n<li class=\"has-small-font-size\">chronyc tracking<\/li>\n\n\n\n<li class=\"has-small-font-size\">\u516d\u3001\u5f3a\u5236\u540c\u6b65\u65f6\u95f4<\/li>\n\n\n\n<li class=\"has-small-font-size\">chronyc -a makestep<\/li>\n\n\n\n<li><\/li>\n\n\n\n<li><strong>CentOS8.2\u8bbe\u7f6e\u65f6\u533a<\/strong><\/li>\n\n\n\n<li class=\"has-small-font-size\">\u5728CentOS 8.2\u4e0a\u8bbe\u7f6e\u65f6\u533a\u53ef\u4ee5\u6309\u7167\u4ee5\u4e0b\u6b65\u9aa4\u8fdb\u884c\u64cd\u4f5c\uff1a<\/li>\n\n\n\n<li class=\"has-small-font-size\">\u9996\u5148\u767b\u5f55\u5230CentOS\u670d\u52a1\u5668\u7684\u547d\u4ee4\u884c\u754c\u9762\u3002<\/li>\n\n\n\n<li class=\"has-small-font-size\">\u4f7f\u7528root\u6216\u8005\u6709\u7ba1\u7406\u5458\u6743\u9650\u7684\u8d26\u6237\u8fd0\u884c\u4ee5\u4e0b\u547d\u4ee4\u6765\u5b89\u88c5tzdata\u5305\uff08\u5982\u679c\u5df2\u7ecf\u5b89\u88c5\u4e86\u8be5\u5305\u5219\u53ef\u4ee5\u8df3\u8fc7\u6b64\u6b65\u9aa4\uff09\uff1a<\/li>\n\n\n\n<li class=\"has-small-font-size\"><code>yum install tzdata -y<\/code><\/li>\n\n\n\n<li class=\"has-small-font-size\">\u786e\u5b9a\u8981\u8bbe\u7f6e\u7684\u65f6\u533a\u4fe1\u606f\u3002\u53ef\u4ee5\u901a\u8fc7<code>timedatectl list-timezones<\/code>\u547d\u4ee4\u67e5\u770b\u6240\u6709\u53ef\u9009\u7684\u65f6\u533a\u5217\u8868\u3002<\/li>\n\n\n\n<li class=\"has-small-font-size\">\u6839\u636e\u9700\u6c42\u9009\u62e9\u5408\u9002\u7684\u65f6\u533a\u5e76\u5c06\u5176\u5e94\u7528\u4e8e\u7cfb\u7edf\u4e2d\u3002<br>\u6bd4\u5982\uff0c\u82e5\u60f3\u5c06\u65f6\u533a\u8bbe\u7f6e\u4e3a&#8221;Asia\/Shanghai&#8221;\uff0c\u53ef\u4ee5\u8fd0\u884c\u4ee5\u4e0b\u547d\u4ee4\uff1a<\/li>\n\n\n\n<li class=\"has-small-font-size\"><code>timedatectl set-timezone Asia\/Shanghai<\/code><\/li>\n\n\n\n<li class=\"has-small-font-size\">\u6700\u540e\uff0c\u91cd\u65b0\u52a0\u8f7d\u7cfb\u7edf\u7684\u65f6\u95f4\u914d\u7f6e\u6587\u4ef6\u4ee5\u4f7f\u66f4\u6539\u751f\u6548\uff1a<\/li>\n\n\n\n<li class=\"has-small-font-size\"><code>systemctl restart systemd-timesyncd<\/code><\/li>\n\n\n\n<li class=\"has-small-font-size\">\u8fd9\u6837\u5c31\u5b8c\u6210\u4e86\u5728CentOS 8.2\u4e0a\u8bbe\u7f6e\u65f6\u533a\u7684\u64cd\u4f5c\u3002<\/li>\n<\/ul>\n","protected":false},"excerpt":{"rendered":"<p>Error: Failed to download metadata for repo &#8216;apps<br \/><a class=\"moretag\" href=\"http:\/\/www.x4s.cn\/?p=392\">+ Read More<\/a><\/p>\n","protected":false},"author":1,"featured_media":0,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[4],"tags":[],"class_list":["post-392","post","type-post","status-publish","format-standard","hentry","category-apps"],"_links":{"self":[{"href":"http:\/\/www.x4s.cn\/index.php?rest_route=\/wp\/v2\/posts\/392","targetHints":{"allow":["GET"]}}],"collection":[{"href":"http:\/\/www.x4s.cn\/index.php?rest_route=\/wp\/v2\/posts"}],"about":[{"href":"http:\/\/www.x4s.cn\/index.php?rest_route=\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"http:\/\/www.x4s.cn\/index.php?rest_route=\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"http:\/\/www.x4s.cn\/index.php?rest_route=%2Fwp%2Fv2%2Fcomments&post=392"}],"version-history":[{"count":3,"href":"http:\/\/www.x4s.cn\/index.php?rest_route=\/wp\/v2\/posts\/392\/revisions"}],"predecessor-version":[{"id":397,"href":"http:\/\/www.x4s.cn\/index.php?rest_route=\/wp\/v2\/posts\/392\/revisions\/397"}],"wp:attachment":[{"href":"http:\/\/www.x4s.cn\/index.php?rest_route=%2Fwp%2Fv2%2Fmedia&parent=392"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"http:\/\/www.x4s.cn\/index.php?rest_route=%2Fwp%2Fv2%2Fcategories&post=392"},{"taxonomy":"post_tag","embeddable":true,"href":"http:\/\/www.x4s.cn\/index.php?rest_route=%2Fwp%2Fv2%2Ftags&post=392"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}