调用任何尚未安装的可执行文件都会产生一条不易理解的消息:
$ tcl
Der Befehl \xbbtcl\xab wurde nicht gefunden, meinten Sie vielleicht:
Befehl \xbbtel\xab aus dem Paket \xbborville-write\xab (universe)
Befehl \xbbtc\xab aus dem Paket \xbbiproute2\xab (main)
Befehl \xbbtcs\xab aus dem Paket \xbbtcs\xab (universe)
Befehl \xbbtjl\xab aus dem Paket \xbbpvm-examples\xab (universe)
Befehl \xbbcl\xab aus dem Paket \xbbcl-launch\xab (universe)
Befehl \xbbecl\xab aus dem Paket \xbbecl\xab (universe)
Befehl \xbbtcal\xab aus dem Paket \xbbgcal\xab (universe)
Befehl \xbbmcl\xab aus dem Paket \xbbmcl\xab (universe)
Befehl \xbbccl\xab aus dem Paket \xbbcclive\xab (universe)
Befehl \xbbtbl\xab aus dem Paket \xbbgroff-base\xab (main)
Befehl \xbbncl\xab aus dem Paket \xbbncl-ncarg\xab (universe)
Befehl \xbbgcl\xab aus dem Paket \xbbgcl\xab (universe)
Befehl \xbbtdl\xab aus dem Paket \xbbtdl\xab (universe)
Befehl \xbbtcc\xab aus dem Paket \xbbtcc\xab (universe)
Befehl \xbbtcm\xab aus dem Paket \xbbtcm\xab (universe)
tcl: Befehl nicht gefunden.
bogdanbiv@bivub1404:~$ which tcl
bogdanbiv@bivub1404:~$ hgjkh
hgjkh: Befehl nicht gefunden.
另外十六进制字符 (\xbb 和 \xab) 有什么问题。我的系统是 Kubuntu 14.04,值得信赖:
$ lsb_release -a
No LSB modules are available.
Distributor ID: Ubuntu
Description: Ubuntu 14.04.1 LTS
Release: 14.04
Codename: trusty
我的系统语言是英语,但我针对我的国家设置了一些区域设置:
$ 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=en_RO.UTF-8
LANGUAGE=en:de:ro:en
LC_CTYPE="en_RO.UTF-8"
LC_NUMERIC=en_RO.UTF-8
LC_TIME=en_RO.UTF-8
LC_COLLATE="en_RO.UTF-8"
LC_MONETARY=en_RO.UTF-8
LC_MESSAGES="en_RO.UTF-8"
LC_PAPER=en_RO.UTF-8
LC_NAME=en_RO.UTF-8
LC_ADDRESS=en_RO.UTF-8
LC_TELEPHONE=en_RO.UTF-8
LC_MEASUREMENT=en_RO.UTF-8
LC_IDENTIFICATION=en_RO.UTF-8
LC_ALL=
不知怎么的,我偶然发现了一些可能相关的信息(更多信息请参见http://pastebin.com/4XGakzgL):
Command-not-found-Version: 0.3
Python-Version: 3.4.0 final 0
更新:我尝试了各种语言环境修复工具:弹出一个窗口,说我的语言支持不完整,并提出帮助。这很好,但毫无效果。好吧,至少现在,德语消息可以正确显示在 UTF 中,强制使用英语确实有效:
$ LANGUAGE=en tcl
No command 'tcl' found, did you mean: # CORRECT, this should be normal behaviour
$ LANGUAGE=en:de:ro tcl
Der Befehl »tcl« wurde nicht gefunden, meinten Sie vielleicht: # This is German
locale
以下是截至目前的输出:
LANG=en_GB.UTF-8
LANGUAGE=en:de:ro
LC_CTYPE="en_GB.UTF-8"
LC_NUMERIC=en_GB.UTF-8
LC_TIME=en_GB.UTF-8
LC_COLLATE="en_GB.UTF-8"
LC_MONETARY=en_GB.UTF-8
LC_MESSAGES=POSIX
LC_PAPER=en_GB.UTF-8
LC_NAME=en_GB.UTF-8
LC_ADDRESS=en_GB.UTF-8
LC_TELEPHONE=en_GB.UTF-8
LC_MEASUREMENT=en_GB.UTF-8
LC_IDENTIFICATION=en_GB.UTF-8
LC_ALL=
答案1
我认为问题出在错误行:
locale: Cannot set LC_MESSAGES to default locale: No such file or directory
尝试打印消息时,C 库将尝试第一个语言环境(LANGUAGE
您的情况是)en
,但会出现错误;因此它会切换到第二个语言环境de
(德语)。您的de
语言环境可能不是 UFT-8,因此您会得到奇怪的十六进制数据(可能\xbb
是\xab
某种开闭引号)。
顺便问一下,哪个语言环境en_RO
?在我的系统中,我只有以下内容:
en_AG,en_AG.utf8,en_AU.utf8,en_BW.utf8,en_CA.utf8,en_DK.utf8,en_GB.utf8,en_HK.utf8,en_IE.utf8,en_IN,en_IN.utf8,en_NG,en_NG.utf8,en_NZ.utf8,en_PH.utf8,en_SG.utf8,en_US.utf8,en_ZA.utf8,en_ZM,en_ZM.utf8,en_ZW.utf8
所以你可能从一些非标准包中添加了它?(我不知道,只是问问)。
您是否尝试过检查语言支持是否已完全加载?(Gnome 中的“设置”->“语言支持”,可能因 Ubuntu 版本而异)。有时它会变得很混乱,选择该选项会显示以下内容:
在我的系统中它运行正常并且可以正常切换语言:
romano@pern:~$ tcl
No command 'tcl' found, did you mean:
Command 'tcm' from package 'tcm' (universe)
Command 'tcal' from package 'gcal' (universe)
Command 'tcs' from package 'tcs' (universe)
Command 'tdl' from package 'tdl' (universe)
Command 'tcc' from package 'tcc' (universe)
Command 'tel' from package 'orville-write' (universe)
Command 'tjl' from package 'pvm-examples' (universe)
Command 'gcl' from package 'gcl' (universe)
Command 'mcl' from package 'mcl' (universe)
Command 'ncl' from package 'ncl-ncarg' (universe)
Command 'tbl' from package 'groff-base' (main)
Command 'tc' from package 'iproute2' (main)
Command 'cl' from package 'cl-launch' (universe)
Command 'ccl' from package 'cclive' (universe)
Command 'ecl' from package 'ecl' (universe)
tcl: command not found
和
romano@pern:~$ LANGUAGE=it:en tcl
Comando "tcl" non trovato. Forse si intendeva:
Comando "ncl" dal pacchetto "ncl-ncarg" (universe)
Comando "ecl" dal pacchetto "ecl" (universe)
Comando "tel" dal pacchetto "orville-write" (universe)
Comando "ccl" dal pacchetto "cclive" (universe)
Comando "tdl" dal pacchetto "tdl" (universe)
Comando "mcl" dal pacchetto "mcl" (universe)
Comando "tcc" dal pacchetto "tcc" (universe)
Comando "tc" dal pacchetto "iproute2" (main)
Comando "tbl" dal pacchetto "groff-base" (main)
Comando "cl" dal pacchetto "cl-launch" (universe)
Comando "tcm" dal pacchetto "tcm" (universe)
Comando "gcl" dal pacchetto "gcl" (universe)
Comando "tcal" dal pacchetto "gcal" (universe)
Comando "tjl" dal pacchetto "pvm-examples" (universe)
Comando "tcs" dal pacchetto "tcs" (universe)
tcl: comando non trovato