明輝手游網(wǎng)中心:是一個免費提供流行視頻軟件教程、在線學習分享的學習平臺!

Ubuntu系統(tǒng)更改Locale時出現(xiàn)出錯怎么處理?

[摘要]Ubuntu修改Locale的目的就是更改Linux系統(tǒng)的語言環(huán)境,但是Ubuntu修改Locale經常出現(xiàn)一個錯誤,導致出現(xiàn)中文亂碼等一系列的問題。本文就來介紹一下Ubuntu系統(tǒng)修改Locale...

  Ubuntu修改Locale的目的就是更改Linux系統(tǒng)的語言環(huán)境,但是Ubuntu修改Locale經常出現(xiàn)一個錯誤,導致出現(xiàn)中文亂碼等一系列的問題。本文就來介紹一下Ubuntu系統(tǒng)修改Locale過程出現(xiàn)錯誤怎么解決?

Ubuntu系統(tǒng)修改Locale時出現(xiàn)錯誤怎么解決?

  問題描述

  終端顯示中文正常,應用程序里面顯示中文異常。

  錯誤表現(xiàn)

  1$ sudo dpkg-reconfigure locales

  perl: warning: Setting locale failed.

  perl: warning: Please check that your locale settings:

  LANGUAGE = “zh_CN:zh:en_US:en”,

  LC_ALL = “zh_CN.UTF-8”,

  LANG = “zh_CN.UTF-8”

  are supported and installed on your system.

  perl: warning: Falling back to the standard locale (“C”)。

  locale: Cannot set LC_CTYPE to default locale: No such file or directory

  locale: Cannot set LC_MESSAGES to default locale: No such file or directory

  locale: Cannot set LC_ALL to default locale: No such file or directory

  /bin/bash: warning: setlocale: LC_ALL: cannot change locale (zh_CN.UTF-8)

  Generating locales.。。

  en_US.UTF-8.。。 /usr/sbin/locale-gen: line 177: warning: setlocale: LC_ALL: cannot change locale (zh_CN.UTF-8)

  up-to-date

  Generation complete.

  1$ man locale

  man: can‘t set the locale; make sure $LC_* and $LANG are correct

  1$ locale

  locale: Cannot set LC_CTYPE to default locale: No such file or directory

  locale: Cannot set LC_MESSAGES to default locale: No such file or directory

  locale: Cannot set LC_ALL to default locale: No such file or directory

  LANG=zh_CN.UTF-8

  LANGUAGE=zh_CN:zh:en_US:en

  LC_CTYPE=“zh_CN.UTF-8”

  LC_NUMERIC=“zh_CN.UTF-8”

  LC_TIME=“zh_CN.UTF-8”

  LC_COLLATE=“zh_CN.UTF-8”

  LC_MONETARY=“zh_CN.UTF-8”

  LC_MESSAGES=“zh_CN.UTF-8”

  LC_PAPER=“zh_CN.UTF-8”

  LC_NAME=“zh_CN.UTF-8”

  LC_ADDRESS=“zh_CN.UTF-8”

  LC_TELEPHONE=“zh_CN.UTF-8”

  LC_MEASUREMENT=“zh_CN.UTF-8”

  LC_IDENTIFICATION=“zh_CN.UTF-8”

  LC_ALL=

  1$ localectl list-locales

  C.UTF-8

  en_US.utf8

  zh_CN.utf8

Linux是一套免費使用和自由傳播的類Unix操作系統(tǒng)