2013-11-09 38 views
4

add命令我问一个问题,在how to write a beautifully elegant linux command in bash shell找不到命令消息时,我尝试的.bashrc

,当我试图建议,我得到了以下错误消息。

Sorry, command-not-found has crashed! Please file a bug report at: 
https://bugs.launchpad.net/command-not-found/+filebug 
Please include the following information with the report: 

command-not-found version: 0.3 
Python version: 3.2.3 final 0 
Distributor ID: Ubuntu 
Description: Ubuntu 12.10 
Release: 12.10 
Codename: quantal 
Exception information: 

unsupported locale setting 
Traceback (most recent call last): 
    File "/usr/lib/python3/dist-packages/CommandNotFound/util.py", line 24, in crash_guard 
    callback() 
    File "/usr/lib/command-not-found", line 69, in main 
    enable_i18n() 
    File "/usr/lib/command-not-found", line 40, in enable_i18n 
    locale.setlocale(locale.LC_ALL, '') 
    File "/usr/lib/python3.2/locale.py", line 541, in setlocale 
    return _setlocale(category, locale) 
locale.Error: unsupported locale setting 

这是我目前在我的.bashrc

source .bashrc 
export LC_CTYPE="utf-8" 
function go_app() { cd /var/virtual/$1/; } 

这里写的是我的/ var/www目录

[email protected]:~$ ls -la 
total 52 
drwxr-xr-x 5 www-data www-data 4096 Nov 9 15:03 . 
drwxr-xr-x 15 root  root  4096 Nov 8 09:51 .. 
-rw------- 1 www-data www-data 19657 Nov 7 23:24 .bash_history 
-rwxr-xr-x 1 www-data www-data 82 Nov 9 15:03 .bashrc 
drwx------ 2 www-data www-data 4096 Aug 7 19:28 .cache 
drwxrwxr-x 3 www-data www-data 4096 Aug 9 19:19 .composer 
-rw------- 1 www-data www-data  6 Aug 8 11:48 .mysql_history 
-rw------- 1 root  root  50 Nov 9 15:08 .nano_history 
drwxrwxr-x 2 www-data www-data 4096 Aug 7 20:19 .ssh 

编辑:

新的.bashrc

export LC_CTYPE="en_US.utf8" 
function go_app() { cd /var/virtual/$1/; } 

错误消息:

go_app: command not found 
+0

为什么你在你的''.bashrc'源.bashrc'?这不是递归加载吗? –

+0

这是一个由我原来的问题中的人推荐的修复。我现在已经删除它。并将'export LC_CTYPE =“utf-8”'改为'export LC_CTYPE =“en_US.utf8”'现在只是'go_app:command not found' –

+0

如果你打开一个新的终端,后者是否解决了这个问题? –

回答

1

你有没有试图改变export LC_CTYPE="utf-8"export LC_CTYPE="en_US.utf8"?后者在我的系统上引用了有效的区域设置名称。您可以通过运行locale -a来查看系统上的有效区域设置名称。

+0

仍然收到命令找不到声明。看我更新的问题 –

+0

我猜你把'source .bashrc'放在错误的文件中。正如我所说的,它对于.bashrc来源本身没有任何意义。尝试把它放在正确的文件中。 –

+0

你可以在我的问题中看到我的/ var/www目录。我应该把source.bashrc放在哪个文件中? –

5

这应该可以解决“对不起,命令未找到已崩溃...!”的问题:

export LANGUAGE=en_US.UTF-8 
export LANG=en_US.UTF-8 
export LC_ALL=en_US.UTF-8 
locale-gen en_US.UTF-8 
sudo dpkg-reconfigure locales 
相关问题