{"id":40,"date":"2023-11-20T10:59:53","date_gmt":"2023-11-20T02:59:53","guid":{"rendered":"http:\/\/8.141.4.74\/?p=40"},"modified":"2024-03-29T14:34:42","modified_gmt":"2024-03-29T06:34:42","slug":"linux%e8%ae%be%e7%bd%ae%e8%af%ad%e8%a8%80%e7%8e%af%e5%a2%83","status":"publish","type":"post","link":"http:\/\/8.141.4.74\/?p=40","title":{"rendered":"Linux \u8bbe\u7f6e\u8bed\u8a00\u73af\u5883"},"content":{"rendered":"<h1>\u8bed\u8a00\u73af\u5883<\/h1>\n<p>\u9ed8\u8ba4\u7cfb\u7edf\u4e3a\u82f1\u6587\u73af\u5883\uff0c\u53ef\u4ee5\u4fee\u6539\u4e3a\u4e2d\u6587\u73af\u5883\uff0c\u4ece\u800c\u67e5\u770b\u5e2e\u52a9\u6216\u63d0\u793a\u53ef\u4ee5\u53d8\u4e3a\u4e2d\u6587<br \/>\n\u8303\u4f8b\uff1a\u4e34\u65f6\u4fee\u6539LANG\u53d8\u91cf\u5b9e\u73b0\u4e2d\u6587\u8bed\u8a00\u63d0\u793a<\/p>\n<pre><code class=\"language-shell\">[root@centos7 ~]#echo $LANG\nen_US.UTF-8\n[root@centos7 ~]#magedu\n-bash:magedu:command not found\n[root@centos7 ~]#LANG=zh_CN.UTF-8\n[root@centos7 ~]#echo $LANG\nzh_CN.UTF-8\n[root@centos7 ~]#magedu\n-bash:magedu:\u672a\u627e\u5230\u547d\u4ee4<\/code><\/pre>\n<p>\u8303\u4f8b\uff1aRocky\u4fee\u6539\u8bed\u8a00\u73af\u5883\u4e3a\u4e2d\u6587<\/p>\n<pre><code class=\"language-shell\">[root@rocky8 ~]#localectl status\nSystem Locale:LANG=en_US.UTF-8\nVC Keymap:us\nX11 Layout:us\n[root@rocky8 ~]#echo $LANG\nen_US.UTF-8\n\n[root@rocky8 ~]#localectl list-locales\nC.utf8\nen_AG\nen_AU\nen_AU.utf8\nen_BW\nen_BW.utf8\nen_CA\nen_CA.utf8\nen_DK\nen_DK.utf8\nen_GB\nen_GB.iso885915\nen_GB.utf8\nen_HK\nen_HK.utf8\nen_IE\nen_IE.utf8\nen_IEQeuro\nen_IL\nen_IN\nen_NG\nen_NZ\nen_NZ.utf8\nen_PH\nen_PH.utf8\nen_SC.utf8\nen_SG\nen_SG.utf8\nen_US\nen_US.iso885915\nen_US.utf8\nen_ZA\nen_ZA.utf8\nen_ZM\nen_ZW\nen_ZW.utf8\n\n[root@rocky8 ~]#yum list lang*\nLast metadata expiration check: 1:26:20 ago on Thu 03 Nov 2022 08:46:49 PM CST.\nInstalled Packages\nlangpacks-en.noarch                                                      1.0-12.el8                                                     @AppStream\nlangtable.noarch                                                         0.0.51-4.el8                                                   @AppStream\nAvailable Packages\nlangpacks-af.noarch                                                      1.0-12.el8                                                     appstream \nlangpacks-am.noarch                                                      1.0-12.el8                                                     appstream \nlangpacks-ar.noarch                                                      1.0-12.el8                                                     appstream \nlangpacks-as.noarch                                                      1.0-12.el8                                                     appstream \nlangpacks-ast.noarch                                                     1.0-12.el8                                                     appstream \nlangpacks-be.noarch                                                      1.0-12.el8                                                     appstream \nlangpacks-bg.noarch                                                      1.0-12.el8                                                     appstream \nlangpacks-bn.noarch                                                      1.0-12.el8                                                     appstream \nlangpacks-br.noarch                                                      1.0-12.el8                                                     appstream \nlangpacks-bs.noarch                                                      1.0-12.el8                                                     appstream \nlangpacks-ca.noarch                                                      1.0-12.el8                                                     appstream \nlangpacks-cs.noarch                                                      1.0-12.el8                                                     appstream \nlangpacks-cy.noarch                                                      1.0-12.el8                                                     appstream \nlangpacks-da.noarch                                                      1.0-12.el8                                                     appstream \nlangpacks-de.noarch                                                      1.0-12.el8                                                     appstream \nlangpacks-el.noarch                                                      1.0-12.el8                                                     appstream \nlangpacks-en_GB.noarch                                                   1.0-12.el8                                                     appstream \nlangpacks-es.noarch                                                      1.0-12.el8                                                     appstream \nlangpacks-et.noarch                                                      1.0-12.el8                                                     appstream \nlangpacks-eu.noarch                                                      1.0-12.el8                                                     appstream \nlangpacks-fa.noarch                                                      1.0-12.el8                                                     appstream \nlangpacks-fi.noarch                                                      1.0-12.el8                                                     appstream \nlangpacks-fr.noarch                                                      1.0-12.el8                                                     appstream \nlangpacks-ga.noarch                                                      1.0-12.el8                                                     appstream \nlangpacks-gl.noarch                                                      1.0-12.el8                                                     appstream \nlangpacks-gu.noarch                                                      1.0-12.el8                                                     appstream \nlangpacks-he.noarch                                                      1.0-12.el8                                                     appstream \nlangpacks-hi.noarch                                                      1.0-12.el8                                                     appstream \nlangpacks-hr.noarch                                                      1.0-12.el8                                                     appstream \nlangpacks-hu.noarch                                                      1.0-12.el8                                                     appstream \nlangpacks-ia.noarch                                                      1.0-12.el8                                                     appstream \nlangpacks-id.noarch                                                      1.0-12.el8                                                     appstream \nlangpacks-is.noarch                                                      1.0-12.el8                                                     appstream \nlangpacks-it.noarch                                                      1.0-12.el8                                                     appstream \nlangpacks-ja.noarch                                                      1.0-12.el8                                                     appstream \nlangpacks-kk.noarch                                                      1.0-12.el8                                                     appstream \nlangpacks-kn.noarch                                                      1.0-12.el8                                                     appstream \nlangpacks-ko.noarch                                                      1.0-12.el8                                                     appstream \nlangpacks-lt.noarch                                                      1.0-12.el8                                                     appstream \nlangpacks-lv.noarch                                                      1.0-12.el8                                                     appstream \nlangpacks-mai.noarch                                                     1.0-12.el8                                                     appstream \nlangpacks-mk.noarch                                                      1.0-12.el8                                                     appstream \nlangpacks-ml.noarch                                                      1.0-12.el8                                                     appstream \nlangpacks-mr.noarch                                                      1.0-12.el8                                                     appstream \nlangpacks-ms.noarch                                                      1.0-12.el8                                                     appstream \nlangpacks-nb.noarch                                                      1.0-12.el8                                                     appstream \nlangpacks-ne.noarch                                                      1.0-12.el8                                                     appstream \nlangpacks-nl.noarch                                                      1.0-12.el8                                                     appstream \nlangpacks-nn.noarch                                                      1.0-12.el8                                                     appstream \nlangpacks-nr.noarch                                                      1.0-12.el8                                                     appstream \nlangpacks-nso.noarch                                                     1.0-12.el8                                                     appstream \nlangpacks-or.noarch                                                      1.0-12.el8                                                     appstream \nlangpacks-pa.noarch                                                      1.0-12.el8                                                     appstream \nlangpacks-pl.noarch                                                      1.0-12.el8                                                     appstream \nlangpacks-pt.noarch                                                      1.0-12.el8                                                     appstream \nlangpacks-pt_BR.noarch                                                   1.0-12.el8                                                     appstream \nlangpacks-ro.noarch                                                      1.0-12.el8                                                     appstream \nlangpacks-ru.noarch                                                      1.0-12.el8                                                     appstream \nlangpacks-si.noarch                                                      1.0-12.el8                                                     appstream \nlangpacks-sk.noarch                                                      1.0-12.el8                                                     appstream \nlangpacks-sl.noarch                                                      1.0-12.el8                                                     appstream \nlangpacks-sq.noarch                                                      1.0-12.el8                                                     appstream \nlangpacks-sr.noarch                                                      1.0-12.el8                                                     appstream \nlangpacks-ss.noarch                                                      1.0-12.el8                                                     appstream \nlangpacks-sv.noarch                                                      1.0-12.el8                                                     appstream \nlangpacks-ta.noarch                                                      1.0-12.el8                                                     appstream \nlangpacks-te.noarch                                                      1.0-12.el8                                                     appstream \nlangpacks-th.noarch                                                      1.0-12.el8                                                     appstream \nlangpacks-tn.noarch                                                      1.0-12.el8                                                     appstream \nlangpacks-tr.noarch                                                      1.0-12.el8                                                     appstream \nlangpacks-ts.noarch                                                      1.0-12.el8                                                     appstream \nlangpacks-uk.noarch                                                      1.0-12.el8                                                     appstream \nlangpacks-ur.noarch                                                      1.0-12.el8                                                     appstream \nlangpacks-ve.noarch                                                      1.0-12.el8                                                     appstream \nlangpacks-vi.noarch                                                      1.0-12.el8                                                     appstream \nlangpacks-xh.noarch                                                      1.0-12.el8                                                     appstream \nlangpacks-zh_CN.noarch                                                   1.0-12.el8                                                     appstream \nlangpacks-zh_TW.noarch                                                   1.0-12.el8                                                     appstream \nlangpacks-zu.noarch                                                      1.0-12.el8                                                     appstream \n\n#\u5b89\u88c5\u8bed\u8a00\u5305\n[root@rocky8 ~]#yum -y install \n[root@rocky8 ~]#yum -y install langpacks-zh_CN.noarch\nLast metadata expiration check: 4:08:15 ago on Sun 13 Nov 2022 05:00:24 PM CST.\nDependencies resolved.\n==================================================================================================================================================\n Package                                 Architecture                 Version                               Repository                       Size\n==================================================================================================================================================\nInstalling:\n langpacks-zh_CN                         noarch                       1.0-12.el8                            appstream                       9.6 k\nInstalling weak dependencies:\n glibc-langpack-zh                       x86_64                       2.28-164.el8                          baseos                          2.2 M\n\nTransaction Summary\n==================================================================================================================================================\nInstall  2 Packages\n\nTotal download size: 2.2 M\nInstalled size: 15 M\nDownloading Packages:\n(1\/2): langpacks-zh_CN-1.0-12.el8.noarch.rpm                                                                      8.0 kB\/s | 9.6 kB     00:01    \n(2\/2): glibc-langpack-zh-2.28-164.el8.x86_64.rpm                                                                  1.0 MB\/s | 2.2 MB     00:02    \n--------------------------------------------------------------------------------------------------------------------------------------------------\nTotal                                                                                                             1.0 MB\/s | 2.2 MB     00:02     \nRunning transaction check\nTransaction check succeeded.\nRunning transaction test\nTransaction test succeeded.\nRunning transaction\n  Preparing        :                                                                                                                          1\/1 \n  Installing       : glibc-langpack-zh-2.28-164.el8.x86_64                                                                                    1\/2 \n  Installing       : langpacks-zh_CN-1.0-12.el8.noarch                                                                                        2\/2 \n  Running scriptlet: langpacks-zh_CN-1.0-12.el8.noarch                                                                                        2\/2 \n  Verifying        : langpacks-zh_CN-1.0-12.el8.noarch                                                                                        1\/2 \n  Verifying        : glibc-langpack-zh-2.28-164.el8.x86_64                                                                                    2\/2 \n\nInstalled:\n  glibc-langpack-zh-2.28-164.el8.x86_64                                     langpacks-zh_CN-1.0-12.el8.noarch                                    \n\nComplete!\n[root@centos8 ~]#localectl set-locale LANG=zh_CN.utf8\n#\u901a\u7528\u65b9\u6cd5\n[root@rocky8 ~]#localectl set-locale LANG=zh_CN.utf8\n#\u6216\u8005\u4e0b\u9762\u65b9\u5f0f\uff0cCent0S8\u652f\u6301\uff0c\u4f46ubuntui\u548cCentos7\u4e0d\u652f\u6301\uff0c\u4e0d\u5efa\u8bae\u4f7f\u7528\n[root@rocky8 ~]#localectl set-locale zh_CN.utf8\n[root@rocky8 ~]#localect]status\nSystem Locale:LANG=zh_CN.utf8\nVC Keymap:us\nX11 Layout:us\n[root@rocky8 ~]#echo SLANG\nzh_CN.utf8\n#\u91cd\u65b0\u767b\u5f55\u540e\u53ef\u4ee5\u770b\u5230\u4e2d\u6587\u73af\u5883\n[root@rocky8 ~]#exit<\/code><\/pre>\n<p>\u8303\u4f8b\uff1aUbuntu22.04\u4fee\u6539\u8bed\u8a00\u73af\u5883\u4e3a\u4e2d\u6587<\/p>\n<pre><code class=\"language-shell\">[root@ubuntu2204 ~]#localectl status\n   System Locale: LANG=en_US.UTF-8\n       VC Keymap: n\/a\n      X11 Layout: cn\n       X11 Model: pc105\n\n[root@ubuntu2204 ~]#apt install language-pack-zh-hans -y\n[root@ubuntu2204 ~]#localectl list-locales \nC.UTF-8\nen_US.UTF-8\nzh_CN.UTF-8\nzh_SG.UTF-8\n[root@ubuntu2204 ~]#localectl set-locale LANG=zh_CN.UTF-8\n[root@ubuntu2204 ~]#exit\n[root@ubuntu2204 ~]#localectl status\n   System Locale: LANG=zh_CN.UTF-8\n       VC Keymap: n\/a\n      X11 Layout: cn\n       X11 Model: pc105\n\n[root@ubuntu2204 ~]#echo $LANG\nzh_CN.UTF-8\n<\/code><\/pre>\n","protected":false},"excerpt":{"rendered":"<p>\u8bed\u8a00\u73af\u5883 \u9ed8\u8ba4\u7cfb\u7edf\u4e3a\u82f1\u6587\u73af\u5883\uff0c\u53ef\u4ee5\u4fee\u6539\u4e3a\u4e2d\u6587\u73af\u5883\uff0c\u4ece\u800c\u67e5\u770b\u5e2e\u52a9\u6216\u63d0\u793a\u53ef\u4ee5\u53d8\u4e3a\u4e2d\u6587 \u8303\u4f8b\uff1a\u4e34\u65f6\u4fee\u6539LA [&hellip;]<\/p>\n","protected":false},"author":1,"featured_media":0,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[3],"tags":[7],"views":326,"_links":{"self":[{"href":"http:\/\/8.141.4.74\/index.php?rest_route=\/wp\/v2\/posts\/40"}],"collection":[{"href":"http:\/\/8.141.4.74\/index.php?rest_route=\/wp\/v2\/posts"}],"about":[{"href":"http:\/\/8.141.4.74\/index.php?rest_route=\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"http:\/\/8.141.4.74\/index.php?rest_route=\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"http:\/\/8.141.4.74\/index.php?rest_route=%2Fwp%2Fv2%2Fcomments&post=40"}],"version-history":[{"count":8,"href":"http:\/\/8.141.4.74\/index.php?rest_route=\/wp\/v2\/posts\/40\/revisions"}],"predecessor-version":[{"id":445,"href":"http:\/\/8.141.4.74\/index.php?rest_route=\/wp\/v2\/posts\/40\/revisions\/445"}],"wp:attachment":[{"href":"http:\/\/8.141.4.74\/index.php?rest_route=%2Fwp%2Fv2%2Fmedia&parent=40"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"http:\/\/8.141.4.74\/index.php?rest_route=%2Fwp%2Fv2%2Fcategories&post=40"},{"taxonomy":"post_tag","embeddable":true,"href":"http:\/\/8.141.4.74\/index.php?rest_route=%2Fwp%2Fv2%2Ftags&post=40"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}