我正在尝试安装Ms SQL Server
,ubuntu 17.10
我逐步运行命令:
wget -qO- https://packages.microsoft.com/keys/microsoft.asc | sudo apt-key add -
sudo add-apt-repository "$(wget -qO- https://packages.microsoft.com/config/ubuntu/16.04/mssql-server-2017.list)"
sudo apt-get update
sudo apt-get install -y mssql-server
当我运行安装命令时:
sudo /opt/mssql/bin/mssql-conf setup
我收到以下错误:
Traceback (most recent call last):
File "/opt/mssql/bin/../lib/mssql-conf/mssql-conf.py", line 277, in <module>
main()
File "/opt/mssql/bin/../lib/mssql-conf/mssql-conf.py", line 273, in main
processCommands()
File "/opt/mssql/bin/../lib/mssql-conf/mssql-conf.py", line 197, in processCommands
COMMAND_TABLE[args.which]()
File "/opt/mssql/bin/../lib/mssql-conf/mssql-conf.py", line 54, in handleSetup
exit(mssqlconfhelper.setupSqlServer(eulaAccepted, noprompt=args.noprompt))
File "/opt/mssql/lib/mssql-conf/mssqlconfhelper.py", line 817, in setupSqlServer
languageSelect(noprompt)
File "/opt/mssql/lib/mssql-conf/mssqlconfhelper.py", line 160, in languageSelect
language = locale.getdefaultlocale()[0]
File "/usr/lib/python2.7/locale.py", line 545, in getdefaultlocale
return _parse_localename(localename)
File "/usr/lib/python2.7/locale.py", line 477, in _parse_localename
raise ValueError, 'unknown locale: %s' % localename
ValueError: unknown locale: UTF-8
locale
命令输出:
locale: Cannot set LC_CTYPE to default locale: No such file or directory
locale: Cannot set LC_ALL to default locale: No such file or directory
LANG=C.UTF-8
LANGUAGE=
LC_CTYPE=UTF-8
LC_NUMERIC="C.UTF-8"
LC_TIME="C.UTF-8"
LC_COLLATE="C.UTF-8"
LC_MONETARY="C.UTF-8"
LC_MESSAGES="C.UTF-8"
LC_PAPER="C.UTF-8"
LC_NAME="C.UTF-8"
LC_ADDRESS="C.UTF-8"
LC_TELEPHONE="C.UTF-8"
LC_MEASUREMENT="C.UTF-8"
LC_IDENTIFICATION="C.UTF-8"
LC_ALL=
root@ubuntu-mssql-server:~#
解决方案是什么?
答案1
作为一种解决方法,我建议您打开~/.profile
文件进行编辑并添加以下行:
unset LC_CTYPE
这应该可以弥补这个问题。
答案2
从其他论坛读到我发现如果更改名为“LC_ALL”的局部变量,则必须将其设置为以下值:en_US.UTF-8
。
执行此操作的方法是作为 root 执行以下命令:
export LC_ALL=en_US.UTF-8