有关CentOS6的man报错
摘自 一刀流的专栏 再加上自己的一些做法。
1)对于找不到的命令,man会报错:
[jing@CentOS locale]$ man abc
Cannot open the message catalog "man" for locale "zh_CN.UTF-8"
(NLSPATH="/usr/share/locale/%l/LC_MESSAGES/%N")
No manual entry for abc
[jing@CentOS locale]$
2)用strace看了一下,
strace man abc (strace 是一个调试命令。具体的使用详解可以看http://blog.csdn.net/rufeng18/article/details/3314216)
发现在最后:
...
open("/usr/share/locale/zh/LC_MESSAGES/man", O_RDONLY) = -1 ENOENT (No such file or directory)
open("/usr/share/locale/zh_CN.UTF-8/man", O_RDONLY) = -1 ENOENT (No such file or directory)
open("/usr/share/locale/zh_CN.UTF-8/LC_MESSAGES/man", O_RDONLY) = -1 ENOENT (No such file or directory)
open("/usr/share/locale/zh/man", O_RDONLY) = -1 ENOENT (No such file or directory)
open("/usr/share/locale/zh/LC_MESSAGES/man", O_RDONLY) = -1 ENOENT (No such file or directory)
open("/usr/share/locale/zh/LC_MESSAGES/man", O_RDONLY) = -1 ENOENT (No such file or directory)
open("/usr/share/locale/zh_CN.UTF-8/man", O_RDONLY) = -1 ENOENT (No such file or directory)
open("/usr/share/locale/zh_CN.UTF-8/LC_MESSAGES/man", O_RDONLY) = -1 ENOENT (No such file or directory)
open("/usr/share/locale/zh/man", O_RDONLY) = -1 ENOENT (No such file or directory)
open("/usr/share/locale/zh/LC_MESSAGES/man", O_RDONLY) = -1 ENOENT (No such file or directory)
open("/usr/share/locale/zh/LC_MESSAGES/man", O_RDONLY) = -1 ENOENT (No such file or directory)
open("/usr/share/locale/zh_CN.UTF-8/man", O_RDONLY) = -1 ENOENT (No such file or directory)
write(2, "Cannot open the message catalog "..., 112Cannot open the message catalog "man" for locale
"zh_CN.UTF-8"
(NLSPATH="/usr/share/locale/%l/LC_MESSAGES/%N")
) = 112
write(2, "No manual entry for abc\n", 24No manual entry for abc
) = 24
exit_group(1) = ?
3)将en下的man复制过来,先凑合用用:
cp /usr/share/locale/en/LC_MESSAGES/man /usr/share/locale/zh/LC_MESSAGES/
4)不报错了:
[jing@CentOS locale]$ man abc
No manual entry for abc
[jing@CentOS locale]$