{"id":7085,"date":"2020-08-28T12:58:39","date_gmt":"2020-08-28T04:58:39","guid":{"rendered":"https:\/\/www.linuxcool.com\/?p=7085"},"modified":"2020-08-28T12:58:39","modified_gmt":"2020-08-28T04:58:39","slug":"localectl","status":"publish","type":"post","link":"https:\/\/www.linuxcool.com\/localectl","title":{"rendered":"localectl\u547d\u4ee4 – \u63a7\u5236\u7cfb\u7edf\u7684\u672c\u5730\u5316\u4e0e\u952e\u76d8\u5e03\u5c40"},"content":{"rendered":"\n

localectl\u547d\u4ee4\u53ef\u7528\u4e8e\u67e5\u8be2\u4e0e\u4fee\u6539\u7cfb\u7edf\u7684\u672c\u5730\u5316(locale)\u4e0e\u952e\u76d8\u5e03\u5c40\u7684\u8bbe\u7f6e\u3002 \u5b83\u901a\u8fc7\u4e0esystemd-localed.service\u901a\u4fe1\u6765\u4fee\u6539\u4f8b\u5982 \/etc\/locale.conf \u4e0e \/etc\/vconsole.conf \u4e4b\u7c7b\u7684\u914d\u7f6e\u6587\u4ef6\u3002\u672c\u5730\u5316\u8bbe\u7f6e\u63a7\u5236\u7740 \u7528\u6237\u754c\u9762\u7684\u8bed\u8a00\u3001\u5b57\u7b26\u7c7b\u578b\u4e0e\u5b57\u7b26\u7f16\u7801\u3001 \u65e5\u671f\u65f6\u95f4\u4e0e\u8d27\u5e01\u7b26\u53f7\u7684\u8868\u8fbe\u65b9\u5f0f \u7b49\u8bb8\u591a\u7ec6\u8282\u3002<\/p>\n\n\n\n

\u8bed\u6cd5\u683c\u5f0f\uff1a<\/strong>localectl [\u53c2\u6570]<\/p>\n\n\n\n

\u5e38\u7528\u53c2\u6570\uff1a<\/strong><\/p>\n\n\n\n

--no-ask-password<\/td>\u5728\u6267\u884c\u7279\u6743\u64cd\u4f5c\u65f6\u4e0d\u5411\u7528\u6237\u7d22\u8981\u5bc6\u7801<\/td><\/tr>
-H<\/td>\u64cd\u4f5c\u6307\u5b9a\u7684\u8fdc\u7a0b\u4e3b\u673a<\/td><\/tr>
--no-pager<\/td>\u4e0d\u5c06\u7a0b\u5e8f\u7684\u8f93\u51fa\u5185\u5bb9\u7ba1\u9053(pipe)\u7ed9\u5206\u9875\u7a0b\u5e8f<\/td><\/tr>
status<\/td>\u663e\u793a\u5f53\u524d\u7684\u672c\u5730\u5316\u8bbe\u7f6e\u4e0e\u952e\u76d8\u6620\u5c04<\/td><\/tr>
set-locale LOCALE<\/td>\u8bbe\u7f6e\u7cfb\u7edf\u7684\u672c\u5730\u5316\u73af\u5883\u53d8\u91cf<\/td><\/tr><\/tbody><\/table><\/figure>\n\n\n\n

\u53c2\u8003\u5b9e\u4f8b<\/strong><\/p>\n\n\n\n

\u4f7f\u7528localectl\u547d\u4ee4\u8bbe\u7f6e\u7cfb\u7edf\u7684\u672c\u5730\u5316\u5b57\u7b26\u96c6\u73af\u5883\u53d8\u91cf\uff1a<\/p>\n\n\n\n

[root@linuxcool ~]# localectl set-locale LANG=en_US.UTF-8<\/pre>\n\n\n\n

\u663e\u793a\u5f53\u524d\u7684\u672c\u5730\u5316\u8bbe\u7f6e\u4e0e\u952e\u76d8\u6620\u5c04\uff1a<\/p>\n\n\n\n

[root@linuxcool ~]# localectl status<\/pre>\n\n\n\n

\u5217\u51fa\u672c\u5730\u6240\u6709\u5b57\u7b26\u96c6\uff1a<\/p>\n\n\n\n

[root@linuxcool ~]# localectl list-locales<\/pre>\n","protected":false},"excerpt":{"rendered":"

localectl\u547d\u4ee4\u53ef\u7528\u4e8e\u67e5\u8be2\u4e0e\u4fee\u6539\u7cfb\u7edf\u7684\u672c\u5730\u5316(locale)\u4e0e\u952e\u76d8\u5e03\u5c40\u7684\u8bbe\u7f6e\u3002 \u5b83\u901a\u8fc7\u4e0esystemd- […]<\/p>\n","protected":false},"author":1,"featured_media":0,"comment_status":"closed","ping_status":"closed","sticky":false,"template":"","format":"standard","meta":[],"categories":[7],"tags":[],"_links":{"self":[{"href":"https:\/\/www.linuxcool.com\/wp-json\/wp\/v2\/posts\/7085"}],"collection":[{"href":"https:\/\/www.linuxcool.com\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/www.linuxcool.com\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/www.linuxcool.com\/wp-json\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/www.linuxcool.com\/wp-json\/wp\/v2\/comments?post=7085"}],"version-history":[{"count":4,"href":"https:\/\/www.linuxcool.com\/wp-json\/wp\/v2\/posts\/7085\/revisions"}],"predecessor-version":[{"id":7198,"href":"https:\/\/www.linuxcool.com\/wp-json\/wp\/v2\/posts\/7085\/revisions\/7198"}],"wp:attachment":[{"href":"https:\/\/www.linuxcool.com\/wp-json\/wp\/v2\/media?parent=7085"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/www.linuxcool.com\/wp-json\/wp\/v2\/categories?post=7085"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/www.linuxcool.com\/wp-json\/wp\/v2\/tags?post=7085"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}