{"id":17965,"date":"2024-11-18T17:23:49","date_gmt":"2024-11-18T09:23:49","guid":{"rendered":"https:\/\/fwq.ai\/blog\/17965\/"},"modified":"2024-11-18T17:23:49","modified_gmt":"2024-11-18T09:23:49","slug":"centos%e6%80%8e%e4%b9%88%e5%8f%98%e6%88%90%e4%b8%ad%e6%96%87","status":"publish","type":"post","link":"https:\/\/fwq.ai\/blog\/17965\/","title":{"rendered":"centos\u600e\u4e48\u53d8\u6210\u4e2d\u6587"},"content":{"rendered":"<p><strong> \u5982\u4f55\u5207\u6362\u4e3a\u4e2d\u6587<\/strong><\/p>\n<p>\u4e3a\u4e86\u5c06 CentOS \u7cfb\u7edf\u5207\u6362\u4e3a\u4e2d\u6587\uff0c\u60a8\u9700\u8981\u6267\u884c\u4ee5\u4e0b\u6b65\u9aa4\uff1a<\/p>\n<p><strong>1. \u5b89\u88c5\u8bed\u8a00\u5305<\/strong><\/p>\n<p>\u4f7f\u7528\u4ee5\u4e0b\u547d\u4ee4\u5b89\u88c5\u4e2d\u6587\u8bed\u8a00\u5305\uff1a<\/p>\n<pre>yum install centos-release-scl\nyum install centos-language-pack-zh-CN<\/pre>\n<p> \u767b\u5f55\u540e\u590d\u5236 <\/p>\n<p><strong>2. \u542f\u7528\u4e2d\u6587\u8bed\u8a00<\/strong><\/p>\n<p>\u8bbe\u7f6e\u7cfb\u7edf\u8bed\u8a00\u4e3a\u4e2d\u6587\uff1a<\/p>\n<pre>localectl set-locale LANG=zh_CN.UTF-8<\/pre>\n<p> \u767b\u5f55\u540e\u590d\u5236 <\/p>\n<p><strong>3. \u66f4\u65b0\u914d\u7f6e\u6587\u4ef6<\/strong><\/p>\n<p>\u7f16\u8f91\u4ee5\u4e0b\u914d\u7f6e\u6587\u4ef6\uff0c\u5c06\u8bed\u8a00\u8bbe\u7f6e\u4e3a\u4e2d\u6587\uff1a<\/p>\n<ul>\n<li> <strong>\/etc\/default\/locale<\/strong>\uff1a\u5c06 LANG \u8bbe\u7f6e\u4e3a zh_CN.UTF-8<\/li>\n<li> <strong>\/etc\/sysconfig\/i18n<\/strong>\uff1a\u5c06 LANG \u8bbe\u7f6e\u4e3a zh_CN.UTF-8<\/li>\n<\/ul>\n<p><strong>4. \u751f\u6210\u533a\u57df\u8bbe\u7f6e<\/strong><\/p>\n<p>\u751f\u6210\u533a\u57df\u8bbe\u7f6e\uff1a<\/p>\n<pre>locale-gen zh_CN.UTF-8<\/pre>\n<p> \u767b\u5f55\u540e\u590d\u5236 <\/p>\n<p><strong>5. \u91cd\u542f\u7cfb\u7edf<\/strong><\/p>\n<p>\u91cd\u542f\u7cfb\u7edf\u4ee5\u5e94\u7528\u66f4\u6539\uff1a<\/p>\n<pre>reboot<\/pre>\n<p> \u767b\u5f55\u540e\u590d\u5236 <\/p>\n<p><strong>6. \u9a8c\u8bc1\u66f4\u6539<\/strong><\/p>\n<p>\u767b\u5f55\u7cfb\u7edf\u540e\uff0c\u4f7f\u7528\u4ee5\u4e0b\u547d\u4ee4\u9a8c\u8bc1\u8bed\u8a00\u662f\u5426\u5df2\u5207\u6362\u4e3a\u4e2d\u6587\uff1a<\/p>\n<pre>echo $LANG<\/pre>\n<p> \u767b\u5f55\u540e\u590d\u5236 <\/p>\n<p>\u8f93\u51fa\u5e94\u4e3a zh_CN.UTF-8\u3002<\/p>\n<p>\u4ee5\u4e0a\u5c31\u662f\u600e\u4e48\u53d8\u6210\u4e2d\u6587\u7684\u8be6\u7ec6\u5185\u5bb9\uff0c\u66f4\u591a\u8bf7\u5173\u6ce8\u7c73\u4e91\u5176\u5b83\u76f8\u5173\u6587\u7ae0\uff01<\/p>\n","protected":false},"excerpt":{"rendered":"<p>\u5982\u4f55\u5207\u6362\u4e3a\u4e2d\u6587 \u4e3a\u4e86\u5c06 CentOS \u7cfb\u7edf\u5207\u6362\u4e3a\u4e2d\u6587\uff0c\u60a8\u9700\u8981\u6267\u884c\u4ee5\u4e0b\u6b65\u9aa4\uff1a 1. \u5b89\u88c5\u8bed\u8a00\u5305 \u4f7f\u7528\u4ee5\u4e0b\u547d\u4ee4\u5b89\u88c5\u4e2d\u6587\u8bed\u8a00\u5305\uff1a yum install centos-release-scl yum install centos-language-pack-zh-CN \u767b\u5f55\u540e\u590d\u5236 2. \u542f\u7528\u4e2d\u6587\u8bed\u8a00 \u8bbe\u7f6e\u7cfb\u7edf\u8bed\u8a00\u4e3a\u4e2d\u6587\uff1a localectl set-locale LANG=zh_CN.UTF-8 \u767b\u5f55\u540e\u590d\u5236 3. \u66f4\u65b0\u914d\u7f6e\u6587\u4ef6 \u7f16\u8f91\u4ee5\u4e0b\u914d\u7f6e\u6587\u4ef6\uff0c\u5c06\u8bed\u8a00\u8bbe\u7f6e\u4e3a\u4e2d\u6587\uff1a \/etc\/default\/locale\uff1a\u5c06 LANG \u8bbe\u7f6e\u4e3a zh_CN.UTF-8 \/etc\/sysconfig\/i18n\uff1a\u5c06 LANG \u8bbe\u7f6e\u4e3a zh_CN.UTF-8 4. \u751f\u6210\u533a\u57df\u8bbe\u7f6e \u751f\u6210\u533a\u57df\u8bbe\u7f6e\uff1a locale-gen zh_CN.UTF-8 \u767b\u5f55\u540e\u590d\u5236 5. \u91cd\u542f\u7cfb\u7edf \u91cd\u542f\u7cfb\u7edf\u4ee5\u5e94\u7528\u66f4\u6539\uff1a reboot \u767b\u5f55\u540e\u590d\u5236 6. \u9a8c\u8bc1\u66f4\u6539 \u767b\u5f55\u7cfb\u7edf\u540e\uff0c\u4f7f\u7528\u4ee5\u4e0b\u547d\u4ee4\u9a8c\u8bc1\u8bed\u8a00\u662f\u5426\u5df2\u5207\u6362\u4e3a\u4e2d\u6587\uff1a echo $LANG \u767b\u5f55\u540e\u590d\u5236 \u8f93\u51fa\u5e94\u4e3a zh_CN.UTF-8\u3002 \u4ee5\u4e0a\u5c31\u662f\u600e\u4e48\u53d8\u6210\u4e2d\u6587\u7684\u8be6\u7ec6\u5185\u5bb9\uff0c\u66f4\u591a\u8bf7\u5173\u6ce8\u7c73\u4e91\u5176\u5b83\u76f8\u5173\u6587\u7ae0\uff01<\/p>\n","protected":false},"author":1,"featured_media":0,"comment_status":"closed","ping_status":"","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[8],"tags":[],"class_list":["post-17965","post","type-post","status-publish","format-standard","hentry","category-os"],"_links":{"self":[{"href":"https:\/\/fwq.ai\/blog\/wp-json\/wp\/v2\/posts\/17965","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/fwq.ai\/blog\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/fwq.ai\/blog\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/fwq.ai\/blog\/wp-json\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/fwq.ai\/blog\/wp-json\/wp\/v2\/comments?post=17965"}],"version-history":[{"count":0,"href":"https:\/\/fwq.ai\/blog\/wp-json\/wp\/v2\/posts\/17965\/revisions"}],"wp:attachment":[{"href":"https:\/\/fwq.ai\/blog\/wp-json\/wp\/v2\/media?parent=17965"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/fwq.ai\/blog\/wp-json\/wp\/v2\/categories?post=17965"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/fwq.ai\/blog\/wp-json\/wp\/v2\/tags?post=17965"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}