【问题标题】:Unable install SQLserver tool in ubuntu 20无法在 ubuntu 20 中安装 SQLserver 工具
【发布时间】:2020-10-04 19:35:27
【问题描述】:

我在我的 ubuntu 中安装了 SQLserver。但是当我安装 sqlserver-tool 时发生了一些事情。 输入

sudo apt-get install unixodbc-dev

返回

eading 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:
 unixodbc-dev : Depends: unixodbc (= 2.3.7)
                Depends: odbcinst1debian2 (= 2.3.7) but 2.3.6-0.1build1 is to be installed
E: Unable to correct problems, you have held broken packages.

所以我在下面尝试了

sudo apt-get install unixodbc

返回

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:
 unixodbc : Depends: odbcinst1debian2 (>= 2.3.7) but 2.3.6-0.1build1 is to be installed
            Depends: libodbc1 (>= 2.3.7) but 2.3.6-0.1build1 is to be installed
E: Unable to correct problems, you have held broken packages.

最后

sudo apt-get install odbcinst1debian2

返回

eading 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:
 odbcinst1debian2 : PreDepends: multiarch-support but it is not installable
E: Unable to correct problems, you have held broken packages.

我完全堆叠,完全不知道。 剂量任何人都可以帮助我。谢谢。

【问题讨论】:

标签: sql-server bash ubuntu installation


【解决方案1】:

用户 rim96 是对的,原因是微软的源码列表中包含了更高版本(2.3.7)的 unixodbc,它依赖于多架构(不像 Ubuntu 的 2.3.6 版本) 我认为 unixodbc 2.3.6 已经足够好了。就我而言,以下步骤对我有所帮助。

删除微软的源列表。

mv /etc/apt/sources.list.d/mssql-tools.list ~/

更新来源

sudo apt-get update 

从 Ubuntu 存储库安装 unixodbc 2.3.6

sudo apt-get install unixodbc

将微软的源列表移回

mv ~/mssql-tools.list /etc/apt/sources.list.d/

再次更新来源

sudo apt-get update

从微软的存储库安装 mssq-tools(或任何你想要的)

sudo apt-get install mssql-tools

【讨论】:

  • 在新安装的 Ubuntu 上可以正常工作,但文件名略有不同。对于 20.10 上的任何人,我首先通过在此文件 sudo nano /etc/apt/sources.list.d/msprod.list' and then ran 'sudo apt update'. Then I installed the ODBC package sudo apt-get install unixodbc` 的行首添加 # 来注释掉 Microsoft 存储库,这很成功,然后我可以再次运行 sudo apt update,然后能够使用sudo apt-get install mssql-tools 安装工具。
  • 这个过程对我有帮助。非常感谢@jiří-chmiel
【解决方案2】:

用户 Jiří Chmiel 的回答很有帮助,尽管我将两行改为:

    sudo mv /etc/apt/sources.list.d/msprod.list ~/

和:

    sudo mv ~/msprod.list /etc/apt/sources.list.d/

对我有用 (20 年 12 月的 Ubuntu 20.04)

【讨论】:

    【解决方案3】:

    这个问题看起来您在安装odbcinst1debian2 之前忘记运行sudo apt-get 更新。在焦点这个包does not dependmultiarch-support

    来自https://askubuntu.com/questions/1232332/installing-odbcins1debian2-broken-dependency-on-ubuntu-20-04-lts

    【讨论】:

    • 即使做更新,结果也是一样的。我尝试手动安装multarch-support,但无法安装。我在这里发布了一些尝试,
    • apt-cache policy odbcinst1debian2 返回odbcinst1debian2: Installed: 2.3.6-0.1build1 Candidate: 2.3.7 Version table: 2.3.7 500 500 https://packages.microsoft.com/ubuntu/18.04/prod bionic/main amd64 Packages 2.3.7 500 500 https://packages.microsoft.com/ubuntu/19.10/prod eoan/main amd64 Packages *** 2.3.6-0.1build1 500 500 http://jp.archive.ubuntu.com/ubuntu focal/main amd64 Packages 100 /var/lib/dpkg/status
    • lsb_release -a 返回No LSB modules are available. Distributor ID: Ubuntu Description: Ubuntu 20.04 LTS Release: 20.04 Codename: focal
    【解决方案4】:

    如果你关注Microsoft install guide for SQL Server Tools,它会显示 Ubuntu

    如果您使用的是 Ubuntu 18.04 或 Ubuntu 20.04,请将以下步骤 2 中的存储库路径从 /ubuntu/16.04 更改为 /ubuntu/18.04 或 /ubuntu/20.04

    所以在第 2 步中,你应该这样做

    curl https://packages.microsoft.com/config/ubuntu/20.04/prod.list | sudo tee /etc/apt/sources.list.d/msprod.list
    

    而不是

    curl https://packages.microsoft.com/config/ubuntu/16.04/prod.list | sudo tee /etc/apt/sources.list.d/msprod.list
    

    【讨论】:

    • 谢谢,我能够在 Ubuntu 20.04 中安装 mssql-toolsmssql-server-2019.list 中没有)
    猜你喜欢
    • 2020-08-26
    • 2021-03-23
    • 2021-12-02
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 2016-06-03
    • 2019-06-28
    • 1970-01-01
    相关资源
    最近更新 更多