When installing the Linux Ubuntu Server, you can select Chinese characters for installation. After installation, you can find that the results displayed by many commands are garbled, as shown in:
I checked the solution provided by other people on the Internet. It seems that there is no solution yet. The most common method is as follows:
After entering the system
$ Sudo vim/etc/environment
LANG = "zh_CN.UTF-8"
LANGUAGE = "zh_CN: zh"
Change
LANG = "en_GB.UTF-8"
LANGUAGE = "en_US: en"
$ Sudo vim/etc/default/init/locale
Modify reboot
However, this only solves the problem of Chinese display by modifying the encoding method on the SSH client during ssh Login, but the system is still garbled. Even after the "sudo apt-get install language-pack-zh" command is installed, the problem of Chinese display still cannot be solved, the English language is always better than garbled characters, but it is easy to change to an English system:
Sudo vim/var/lib/locales/supported. d/local
Change
En_US.UTF-8 UTF-8
Frank @ ubuntu-server :~ $ Sudo vim/etc/default/locale
Set the following content
LANG = "zh_CN.UTF-8"
LANGUAGE = "zh_CN: zh"
To:
LANG = "en_US.UTF-8"
LANGUAGE = "en_US: en"
Frank @ ubuntu-server :~ $ Sudo locale-gen
Generating locales...
En_US.UTF-8... done
Zh_CN.UTF-8... up-to-date
Zh_HK.UTF-8... up-to-date
Zh_SG.UTF-8... up-to-date
Zh_TW.UTF-8... up-to-date
Generation complete.
After the system is restarted, garbled characters are not displayed in English.
Another method is to install a zhcon, which is a high-efficiency dubyte medium/daily/Korean (CJK) virtual terminal working in the Linux console, just like UCDOS in the DOS environment, provides a complete dubyte language environment for the console environment. Zhcon is an external-mounted platform. Unlike the Chinese kernel, it does not need to be patched with linux kernel. Like a common linux software, zhcon can be easily installed directly. After running zhcon on the main console, you can enter the Chinese platform or exit and return to the Spanish State at any time.
Installation Method:
Sudo apt-get install zhcon
After the installation is complete, run sudo zhcon -- utf8 -- drv = vga to display Chinese characters normally. CRL + D exits zhcon, but the interface is slow after running, that is, the screen flushing is slow. It doesn't mean anything to people.