{"id":286,"date":"2019-08-05T18:08:43","date_gmt":"2019-08-05T10:08:43","guid":{"rendered":"https:\/\/cloudbool.com\/archive\/?p=286"},"modified":"2019-08-05T18:08:43","modified_gmt":"2019-08-05T10:08:43","slug":"debian10-locales-dpkg-reconfigure","status":"publish","type":"post","link":"https:\/\/cloudbool.com\/archive\/debian10-locales-dpkg-reconfigure.html","title":{"rendered":"Debian10\u7cfb\u7edflocales\u53cadpkg-reconfigure\u547d\u4ee4\u8bbe\u7f6e"},"content":{"rendered":"<p>\u4eca\u5929\u60f3\u4f53\u9a8c\u4e0bDebian 10\u7cfb\u7edf\uff0c\u901a\u8fc7\u672c\u5730\u7ec8\u7aefSSH\u8fde\u63a5\u5230VPS\u7684\u65f6\u5019\u53c8\u9047\u5230\u4e86locales\u62a5\u9519\u95ee\u9898\uff0c\u867d\u7136\u95ee\u9898\u4e0d\u5927\uff0c\u4f46\u662f\u4f5c\u4e3a\u4e00\u4e2a\u534a\u540a\u5b50\u6280\u672f\u6e23\u6e23\u5f3a\u8feb\u75c7\uff0c\u8fd8\u662f\u4e0d\u80fd\u5fcd\uff0c\u82b1\u4e86\u70b9\u65f6\u95f4\u89e3\u51b3\u4e86\u4e0b\uff0c\u8fd9\u91cc\u505a\u4e2a\u8bb0\u5f55\u5e0c\u671b\u80fd\u5e2e\u52a9\u5230\u540c\u6837\u9047\u5230\u8fd9\u95ee\u9898\u7684\u670b\u53cb\u3002<br \/>\n<!--more--><\/p>\n<h2>locale\u62a5\u9519<\/h2>\n<p>\u7cfb\u7edf\u662f\u5229\u7528ISO\u955c\u50cf\u65b0\u5b89\u88c5\u7684Debian10\uff0c\u767b\u5f55\u7528\u6237\u975eroot\uff0c\u7528\u7684\u662f\u5b89\u88c5\u8fc7\u7a0b\u4e2d\u8bbe\u7f6e\u7684\u6709\u7ba1\u7406\u5458\u6743\u9650\u7684\u666e\u901a\u8d26\u6237\uff0c\u672c\u5730SSH\u7ec8\u7aef\u662fiTerm2\uff0cSSH\u5230\u8fdc\u7a0bVPS\uff0c\u6267\u884c<strong>apt install<\/strong>\u547d\u4ee4\u4e4b\u540e\u90e8\u5206\u8f93\u51fa\u5982\u4e0b\uff1a<\/p>\n<pre><code>apt-listchanges: Can't set locale; make sure $LC_* and $LANG are correct!\nperl: warning: Setting locale failed.\nperl: warning: Please check that your locale settings:\n    LANGUAGE = (unset),\n    LC_ALL = (unset),\n    LC_CTYPE = \"zh_CN.UTF-8\",\n    LC_TERMINAL = \"iTerm2\",\n    LANG = \"zh_CN.UTF-8\"\n    are supported and installed on your system.\nperl: warning: Falling back to the standard locale (\"C\").\nlocale: Cannot set LC_CTYPE to default locale: No such file or directory\nlocale: Cannot set LC_MESSAGES to default locale: No such file or directory\nlocale: Cannot set LC_ALL to default locale: No such file or directory\n<\/code><\/pre>\n<h2>\u975e\u4f18\u96c5\u89e3\u51b3\u529e\u6cd5<\/h2>\n<p>\u7f51\u4e0a\u6709\u4e9b\u6587\u7ae0\u8bf4\uff0c\u901a\u8fc7\u7f16\u8f91<strong>\/etc\/locale.gen<\/strong>\u53ca<strong>\/etc\/env<\/strong>\u6216\u8005<strong>\/etc\/enviroment<\/strong>\u7b49\u6587\u4ef6\u8bbe\u7f6elocal\uff0c\u8fd9\u4e9b\u90fd\u4e0d\u4f18\u96c5\uff0c\u66f4\u9a9a\u7684\u529e\u6cd5\u662f\u901a\u8fc7\u7cfb\u7edf\u81ea\u5e26\u7684\u547d\u4ee4\u53bb\u4fee\u6539\uff0c\u65b9\u6cd5\u89c1\u5982\u4e0b\u6240\u8ff0\u3002<\/p>\n<h2>\u89e3\u51b3\u529e\u6cd5<\/h2>\n<p>\u51fa\u73b0\u8fd9\u4e2a\u62a5\u9519\u5c31\u662flocale\u8bbe\u7f6e\u6709\u95ee\u9898\uff0c\u6309\u7167\u4e4b\u524d\u7528Debian9\u7684\u7ecf\u9a8c\u6765\u8bf4\uff0c\u5176\u5b9e\u53ea\u8981\u4e00\u884c\u547d\u4ee4\u91cd\u65b0\u8bbe\u7f6elocales\u5c31\u884c\uff0c\u547d\u4ee4\u5982\u4e0b\uff1a<\/p>\n<blockquote><p>\n  dpkg-reconfigure locales\n<\/p><\/blockquote>\n<p>\u4f46\u662f\u5982\u679c\u662f\u5728Debian10\u4e0a\uff0c\u901a\u8fc7\u666e\u901a\u7528\u6237\u767b\u5f55\uff0c\u7136\u540e\u901a\u8fc7<strong>su<\/strong>\u5207\u6362\u5230\u7ba1\u7406\u5458\u6743\u9650\uff0c\u6267\u884c\u5982\u4e0a\u547d\u4ee4\u4f1a\u51fa\u73b0\u5982\u4e0b\u63d0\u793a\uff1a<\/p>\n<pre><code>root@cloudbool-Debian10:~# dpkg-reconfigure locales\nbash: dpkg-reconfigure: command not found\n<\/code><\/pre>\n<p>\u4f46\u662f\u67e5\u627e<strong>dpkg-reconfigure<\/strong>\u8fd9\u4e2a\u547d\u4ee4\u5374\u662f\u5b58\u5728\u4e8e\u7cfb\u7edf\u7684\uff1a<\/p>\n<pre><code>root@cloudbool-Debian10:~# find \/ | grep dpkg-reconfigure\n\/usr\/sbin\/dpkg-reconfigure\n\/usr\/share\/bash-completion\/completions\/dpkg-reconfigure\n\/usr\/share\/man\/de\/man8\/dpkg-reconfigure.8.gz\n\/usr\/share\/man\/ru\/man8\/dpkg-reconfigure.8.gz\n\/usr\/share\/man\/pt\/man8\/dpkg-reconfigure.8.gz\n\/usr\/share\/man\/es\/man8\/dpkg-reconfigure.8.gz\n\/usr\/share\/man\/man8\/dpkg-reconfigure.8.gz\n\/usr\/share\/man\/fr\/man8\/dpkg-reconfigure.8.gz\n<\/code><\/pre>\n<p>\u770b\u53ef\u6267\u884c\u6587\u4ef6\u76ee\u5f55\uff0c\u662f\u9700\u8981root\u6743\u9650\u624d\u80fd\u6267\u884c\uff0c\u76f4\u63a5\u6267\u884c\u4f1a\u62a5\u9519\uff0c\u4f46\u662f\u5982\u679c\u6dfb\u52a0\u5b8c\u5168\u8def\u5f84\u518d\u6267\u884c\uff0c<strong>dpkg-reconfigure<\/strong>\u5c31\u4e0d\u4f1a\u62a5\u9519\u4e86\uff0c\u4f46\u662f\u53e6\u4e00\u4e2a\u547d\u4ee4<strong>locale-gen<\/strong>\u53c8\u627e\u4e0d\u5230\u4e86\uff1a<\/p>\n<pre><code>root@cloudbool-Debian10:~# \/usr\/sbin\/dpkg-reconfigure locales\nperl: warning: Setting locale failed.\nperl: warning: Please check that your locale settings:\n    LANGUAGE = (unset),\n    LC_ALL = (unset),\n    LC_TERMINAL = \"iTerm2\",\n    LC_CTYPE = \"zh_CN.UTF-8\",\n    LANG = \"en_US.UTF-8\"\n    are supported and installed on your system.\nperl: warning: Falling back to a fallback locale (\"en_US.UTF-8\").\nlocale: Cannot set LC_CTYPE to default locale: No such file or directory\nlocale: Cannot set LC_ALL to default locale: No such file or directory\n\/usr\/bin\/locale: Cannot set LC_CTYPE to default locale: No such file or directory\n\/usr\/bin\/locale: Cannot set LC_ALL to default locale: No such file or directory\n\/var\/lib\/dpkg\/info\/locales.postinst: 64: \/var\/lib\/dpkg\/info\/locales.postinst: locale-gen: not found\n<\/code><\/pre>\n<p>\u901a\u8fc7\u67e5\u627e<strong>locale-gen<\/strong>\uff0c\u53d1\u73b0\u8fd9\u4e2a\u547d\u4ee4\u4e5f\u662f\u5728<strong>\/usr\/sbin<\/strong>\u76ee\u5f55\u4e0b\u9762\uff0c\u4f46\u662f\u4e0d\u77e5\u9053\u73af\u5883\u53d8\u91cf<strong>PATH<\/strong>\u4e3a\u4ec0\u4e48\u6ca1\u6709\u52a0\u8f7d\u90a3\u51e0\u4e2a<strong>sbin<\/strong>\u7684\u8def\u5f84\uff0c\u65e2\u7136\u6ca1\u6709\u81ea\u52a8\u52a0\u8f7d\uff0c\u90a3\u6211\u4eec\u624b\u52a8\u52a0\u8f7d\u597d\u4e86\uff0c\u4e34\u65f6\u89e3\u51b3\u529e\u6cd5\u5982\u4e0b\uff1a<\/p>\n<pre><code>root@cloudbool-Debian10:~# export PATH=\"\/usr\/local\/sbin:\/usr\/local\/bin:\/usr\/sbin:\/usr\/bin:\/sbin:\/bin\"\n<\/code><\/pre>\n<p>Update\uff1a<br \/>\n\u5176\u5b9e\u6700\u597d\u7684\u65b9\u6cd5\u662f\u6309<strong>Ctrl+D<\/strong>\u9000\u51fa\u5f53\u524droot\u7528\u6237\uff0c\u7136\u540e\u4f7f\u7528<strong>su &#8211;<\/strong>\u91cd\u65b0\u5207\u6362\u5230root\uff0cPATH\u4e2d\u5c31\u6709<strong>sbin<\/strong>\u76f8\u5173\u547d\u4ee4\u4e86\uff0c\u5177\u4f53\u539f\u56e0\u5c31\u662f\uff0cDebian\u57282018\u5e747\u6708\u5207\u6362\u4e86<strong>su<\/strong>\u7684\u5b9e\u73b0\u65b9\u5f0f\uff0c\u5dee\u522b\u8bf7\u67e5\u770b\u8fd9\u91cc\uff1a<br \/>\nhttps:\/\/sources.debian.org\/src\/util-linux\/2.33.1-0.1\/debian\/util-linux.NEWS\/<br \/>\n\u6211\u62ff\u624b\u4e0a\u673a\u5668\u8bd5\u4e86\u4e0b\uff0c\u53d1\u73b0\u9664\u4e86Debian\u662f\u8fd9\u6837\uff0cUbuntu\u8fd9\u4e24\u4e2a\u547d\u4ee4\u4e5f\u662f\u6709\u533a\u522b\u7684\uff0c\u5982\u4e0b\uff1a<\/p>\n<pre><code>zoco@Ubuntu1804:~$ su\nPassword:\nroot@Ubuntu1804:\/home\/zoco# echo $PATH\n\/usr\/local\/sbin:\/usr\/local\/bin:\/usr\/sbin:\/usr\/bin:\/sbin:\/bin:\/usr\/games:\/usr\/local\/games\nroot@Ubuntu1804:\/home\/zoco# exit\nzoco@Ubuntu1804:~$ su -\nPassword:\nroot@Ubuntu1804:~# echo $PATH\n\/usr\/local\/sbin:\/usr\/local\/bin:\/usr\/sbin:\/usr\/bin:\/sbin:\/bin:\/usr\/games:\/usr\/local\/games:\/snap\/bin\n<\/code><\/pre>\n","protected":false},"excerpt":{"rendered":"<p>\u4eca\u5929\u60f3\u4f53\u9a8c\u4e0bDebian 10\u7cfb\u7edf\uff0c\u901a\u8fc7\u672c\u5730\u7ec8\u7aefSSH\u8fde\u63a5\u5230VPS\u7684\u65f6\u5019\u53c8\u9047\u5230\u4e86locales\u62a5\u9519\u95ee\u9898\uff0c\u867d\u7136\u95ee &hellip;<\/p>\n<p class=\"read-more\"> <a class=\"\" href=\"https:\/\/cloudbool.com\/archive\/debian10-locales-dpkg-reconfigure.html\"> <span class=\"screen-reader-text\">Debian10\u7cfb\u7edflocales\u53cadpkg-reconfigure\u547d\u4ee4\u8bbe\u7f6e<\/span> \u67e5\u770b\u5168\u6587 &raquo;<\/a><\/p>\n","protected":false},"author":1,"featured_media":0,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"site-sidebar-layout":"default","site-content-layout":"","ast-site-content-layout":"","site-content-style":"default","site-sidebar-style":"default","ast-global-header-display":"","ast-banner-title-visibility":"","ast-main-header-display":"","ast-hfb-above-header-display":"","ast-hfb-below-header-display":"","ast-hfb-mobile-header-display":"","site-post-title":"","ast-breadcrumbs-content":"","ast-featured-img":"","footer-sml-layout":"","theme-transparent-header-meta":"","adv-header-id-meta":"","stick-header-meta":"","header-above-stick-meta":"","header-main-stick-meta":"","header-below-stick-meta":"","astra-migrate-meta-layouts":"","ast-page-background-enabled":"default","ast-page-background-meta":{"desktop":{"background-color":"var(--ast-global-color-4)","background-image":"","background-repeat":"repeat","background-position":"center center","background-size":"auto","background-attachment":"scroll","background-type":"","background-media":"","overlay-type":"","overlay-color":"","overlay-gradient":""},"tablet":{"background-color":"","background-image":"","background-repeat":"repeat","background-position":"center center","background-size":"auto","background-attachment":"scroll","background-type":"","background-media":"","overlay-type":"","overlay-color":"","overlay-gradient":""},"mobile":{"background-color":"","background-image":"","background-repeat":"repeat","background-position":"center center","background-size":"auto","background-attachment":"scroll","background-type":"","background-media":"","overlay-type":"","overlay-color":"","overlay-gradient":""}},"ast-content-background-meta":{"desktop":{"background-color":"var(--ast-global-color-5)","background-image":"","background-repeat":"repeat","background-position":"center center","background-size":"auto","background-attachment":"scroll","background-type":"","background-media":"","overlay-type":"","overlay-color":"","overlay-gradient":""},"tablet":{"background-color":"var(--ast-global-color-5)","background-image":"","background-repeat":"repeat","background-position":"center center","background-size":"auto","background-attachment":"scroll","background-type":"","background-media":"","overlay-type":"","overlay-color":"","overlay-gradient":""},"mobile":{"background-color":"var(--ast-global-color-5)","background-image":"","background-repeat":"repeat","background-position":"center center","background-size":"auto","background-attachment":"scroll","background-type":"","background-media":"","overlay-type":"","overlay-color":"","overlay-gradient":""}},"footnotes":""},"categories":[8],"tags":[],"class_list":["post-286","post","type-post","status-publish","format-standard","hentry","category-tech"],"_links":{"self":[{"href":"https:\/\/cloudbool.com\/archive\/wp-json\/wp\/v2\/posts\/286","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/cloudbool.com\/archive\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/cloudbool.com\/archive\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/cloudbool.com\/archive\/wp-json\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/cloudbool.com\/archive\/wp-json\/wp\/v2\/comments?post=286"}],"version-history":[{"count":0,"href":"https:\/\/cloudbool.com\/archive\/wp-json\/wp\/v2\/posts\/286\/revisions"}],"wp:attachment":[{"href":"https:\/\/cloudbool.com\/archive\/wp-json\/wp\/v2\/media?parent=286"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/cloudbool.com\/archive\/wp-json\/wp\/v2\/categories?post=286"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/cloudbool.com\/archive\/wp-json\/wp\/v2\/tags?post=286"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}