我根据Microsoft 文档安装了 sqlserver 。以下命令正确执行。
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
systemctl status mssql-server
但是当我尝试安装 SQL Server 命令行工具时,出现以下错误。
sudo apt-get install mssql-tools unixodbc-dev
Reading package lists... Done
Building dependency tree
Reading state information... Done
Some packages could not be installed. This may mean that you have
requested an impossible situation or if you are using the unstable
distribution that some required packages have not yet been created
or been moved out of Incoming.
The following information may help to resolve the situation:
The following packages have unmet dependencies:
mssql-tools : Depends: msodbcsql17 (>= 17.3.0.0) but it is not going
to be installed
Depends: msodbcsql17 (< 17.4.0.0) but it is not going to be
installed
E: Unable to correct problems, you have held broken packages.
我的操作系统是 Linux Ubuntu 18.04.1 LTS
搜索后,我找到了请求的包,它位于Microsoft Ubuntu 18.04 存储库,要安装包,您必须先添加 repo。
这将安装
msodbcsql17
对应于 Ubuntu 18.04,打开终端并运行:我有同样的问题,但上述解决方案对我没有锻炼。所以这就是我解决这个问题的方法。
遵循来自微软文档的命令
我有类似的问题,但不一样。在我的情况下,错误是
我正在卸载
msodbc
然后重新安装它。经过一番研究,我需要卸载msodbc17
,然后重新安装。就我而言,这还不够,我被迫执行以下命令:
sudo apt install libodbc1 sudo apt install unixodbc
此问题已在 TechDirectArchive 上正确解决。
解决方案:运行以下命令更新 msodbcsql17 包
有关详细信息,请参阅下面的链接 https://techdirectarchive.com/2020/06/22/error-installing-mssql-on-linux-unable-to-install-msodbcsql17-on-ubuntu/