Linux KDE neon 5.20 上的 MSSQL:安装 SQL Server 命令行工具时出现问题

Linux KDE neon 5.20 上的 MSSQL:安装 SQL Server 命令行工具时出现问题

假设您已经在 KDE neon 实例上成功安装了 mssql-server。

在安装 mssql-tools 和 unixodbc-dev 的步骤中,出现以下错误:

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.

答案1

我通过这些步骤解决了这个问题。

首先,安装多架构支持:

  1. 得到 : wget http://archive.ubuntu.com/ubuntu/pool/main/g/glibc/multiarch-support_2.27-3ubuntu1.2_amd64.deb
  2. 使用 dpkg 安装:sudo dpkg -i multiarch-support_2.27-3ubuntu1.2_amd64.deb

二、安装依赖:

  1. sudo apt install libodbc1
  2. sudo apt install unixodbc
  3. sudo apt-get install msodbcsql17 -y

最后,安装了mssql-tools和unixodbc-dev

  1. sudo ACCEPT_EULA=Y apt install mssql-tools unixodbc-dev

现在我可以连接到服务器sqlcmd -S localhost -U SA -P '<MyPassword>'

相关内容