无法为 Ubuntu 16.04 LTS 安装 mysql-workbench

无法为 Ubuntu 16.04 LTS 安装 mysql-workbench

我查看了几个答案,但没有一个能解决我的问题。首先,我尝试了sudo apt install mysql-workbench -f

表明

The following packages have unmet dependencies:  mysql-workbench :
Depends: libgdal.so.1-1.11.3
                   Depends: libgdal1i (>= 1.8.0) but it is not going to be installed
                   Recommends: mysql-utilities but it is not going to be installed 
E: Unable to correct problems, you have held broken
packages.

如果我尝试安装libgdal1i,它会显示

The following packages have unmet dependencies:  libgdal1i : Depends:
libarmadillo6 but it is not going to be installed
             Depends: libhdf5-10 but it is not going to be installed
             Depends: libnetcdf11 (>= 4.0.1) but it is not going to be installed 
E: Unable to correct problems, you have held broken packages.

这个故事没完没了。我尝试安装一个 dep,但它总是告诉我缺少另一个 dep,需要安装。此外,我不知道为什么它说E: Unable to correct problems, you have held broken。我检查了synaptic-> custom filters-> broken,什么都没有。

此外,我也尝试过,sudo aptitude install mysql-workbench -f因为其他帖子说aptitude这样更好。

The following packages have unmet dependencies:  libgfortran3 :
Depends: gcc-5-base (= 5.3.1-14ubuntu2) but 5.4.0-6ubuntu1~16.04.1 is
installed.  mysql-connector-python : Conflicts: python-mysql.connector
but 2.0.4-1 is to be installed. The following actions will resolve
these dependencies:

      Keep the following packages at their current version: 
1)      libarmadillo6 [Not Installed]   
2)      libarpack2> [Not Installed]   
3)      libgdal1i [Not Installed]
4)      libgfortran3 [Not Installed] 
5)      libhdf5-10 [Not Installed]  
6)      liblapack3 [Not Installed]                        
7)      libnetcdf11 [Not Installed]
8)      mysql-connector-python [Not Installed]
9)      mysql-utilities [Not Installed]
10)     mysql-workbench [Not Installed]                    



Accept this solution? [Y/n/q/?]  No packages will be installed,
upgraded, or removed. 0 packages upgraded, 0 newly installed, 0 to
remove and 0 not to upgrade. Need to get 0 B of archives. After
unpacking 0 B will be used.

我接受了该类型的解决方案enter,但正如您所见,问题并未解决。

最后尝试.deb从官方网站下载并安装,但还是出现类似的错误。

输入apt-cache policy mysql-workbench libgdal1i gcc-5-base libhdf5-10则显示:

mysql-workbench:   
   Installed: (none)
   Candidate: 6.3.6+dfsg-0ubuntu1  Version table:
         6.3.6+dfsg-0ubuntu1 500
            500 http://au.archive.ubuntu.com/ubuntu xenial/universe amd64 Packages 

libgdal1i:   
   Installed: (none)
   Candidate:    1.11.3+dfsg-3build2
   Version table:
         1.11.3+dfsg-3build2 500
            500 http://au.archive.ubuntu.com/ubuntu xenial/universe amd64 Packages 

gcc-5-base:
   Installed: 5.4.0-6ubuntu1~16.04.1
   Candidate: 5.4.0-6ubuntu1~16.04.1
   Version table:
  *** 5.4.0-6ubuntu1~16.04.1 100
            100 /var/lib/dpkg/status
         5.3.1-14ubuntu2 500
            500 http://au.archive.ubuntu.com/ubuntu xenial/main amd64 Packages 

libhdf5-10:
   Installed: (none)
   Candidate:  1.8.16+docs-4ubuntu1
   Version table:
         1.8.16+docs-4ubuntu1 500
            500 http://au.archive.ubuntu.com/ubuntu xenial/universe amd64 Packages

结果apt-cache policy libgfortran3 libarmadillo6 libnetcdf11 python-mysql.connector

libgfortran3: Installed: 5.3.1-14ubuntu2 Candidate: 5.3.1-14ubuntu2 Version table: *** 5.3.1-14ubuntu2 500 500 http://au.archive.ubuntu.com/ubuntu xenial/main amd64 Packages 100 /var/lib/dpkg/status libarmadillo6: Installed: 1:6.500.5+dfsg-1 Candidate: 1:6.500.5+dfsg-1 Version table: *** 1:6.500.5+dfsg-1 500 500 http://au.archive.ubuntu.com/ubuntu xenial/universe amd64 Packages 100 /var/lib/dpkg/status libnetcdf11: Installed: 1:4.4.0-2 Candidate: 1:4.4.0-2 Version table: *** 1:4.4.0-2 500 500 http://au.archive.ubuntu.com/ubuntu xenial/universe amd64 Packages 100 /var/lib/dpkg/status python-mysql.connector: Installed: 2.0.4-1 Candidate: 2.0.4-1 Version table: *** 2.0.4-1 500 500 http://au.archive.ubuntu.com/ubuntu xenial/universe amd64 Packages 500 http://au.archive.ubuntu.com/ubuntu xenial/universe i386 Packages 100 /var/lib/dpkg/status

其结果grep -v ^# -r /etc/apt/sources.list etc/apt/sources.list.d/*.list是:

/etc/apt/sources.list: /etc/apt/sources.list:deb http://au.archive.ubuntu.com/ubuntu/ xenial main restricted /etc/apt/sources.list: /etc/apt/sources.list: /etc/apt/sources.list:deb http://au.archive.ubuntu.com/ubuntu/ xenial universe /etc/apt/sources.list: /etc/apt/sources.list:deb http://au.archive.ubuntu.com/ubuntu/ xenial multiverse /etc/apt/sources.list: /etc/apt/sources.list: /etc/apt/sources.list: /etc/apt/sources.list:deb http://apt.postgresql.org/pub/repos/apt/ xenial-pgdg main /etc/apt/sources.list.d/google-chrome.list:deb [arch=amd64] http://dl.google.com/linux/chrome/deb/ stable main /etc/apt/sources.list.d/mysql.list:deb http://repo.mysql.com/apt/ubuntu/ xenial mysql-apt-config /etc/apt/sources.list.d/mysql.list:deb http://repo.mysql.com/apt/ubuntu/ xenial mysql-5.7 /etc/apt/sources.list.d/mysql.list:deb http://repo.mysql.com/apt/ubuntu/ xenial mysql-tools /etc/apt/sources.list.d/mysql.list:deb-src http://repo.mysql.com/apt/ubuntu/ xenial mysql-5.7 /etc/apt/sources.list.d/slack.list:deb https://packagecloud.io/slacktechnologies/slack/debian/ jessie main /etc/apt/sources.list.d/sublime-text.list:deb https://download.sublimetext.com/ apt/stable/

答案1

看来你忘了sudo apt-get update在安装 MySQL Workbench 之前运行(澳大利亚镜像同步正常,它有正确版本的池中的 gcc-5-base)。

如果没有帮助,请尝试切换到主服务器软件与更新或者software-properties-gtkUbuntu 软件选项卡,设置下载自主服务器)。

确保添加所有官方存储库:

sudo add-apt-repository main
sudo add-apt-repository universe
sudo add-apt-repository multiverse

确保您已启用xenial-updates以下xenial-security部分:

  1. 打开software-properties-gtk
  2. 更新标签
  3. 勾选前两个复选框 -(xenial-updates)并且(xenial-security)
  4. 输入密码,点击认证
  5. 点击关闭, 然后重新加载并等待其完成。

然后运行

sudo apt-get update   
sudo apt-get install -f
sudo apt-get upgrade
sudo apt-get dist-upgrade
sudo apt-get install mysql-workbench

答案2

谢谢aptitude。最后我参考了octave 安装错误 - 依赖:gcc-5-base (= 5.3.1-14ubuntu2).aptitude在你连续输入后会提出多个解决方案n。选择带有降级包的那个。一切都很顺利。

以下软件包有未满足的依赖关系:libgfortran3:依赖:gcc-5-base(= 5.3.1-14ubuntu2),但安装了 5.4.0-6ubuntu1~16.04.1。mysql-connector-python:冲突:python-mysql.connector,但要安装 2.0.4-1。以下操作将解决这些依赖关系:

  Keep the following packages at their current version:

1) libarmadillo6 [未安装]
2) libarpack2 [未安装]
3) libgdal1i [未安装]
4) libgfortran3 [未安装]
5) libhdf5-10 [未安装]
6) liblapack3 [未安装]
7) libnetcdf11 [未安装]
8) mysql-connector-python [未安装]
9) mysql-utilities [未安装]
10) mysql-workbench [未安装]

接受此解决方案吗?[Y/n/q/?] n 以下操作将解决这些依赖关系:

 Keep the following packages at their current version:

1) libarmadillo6 [未安装]
2) libarpack2 [未安装]
3) libgdal1i [未安装]
4) libgfortran3 [未安装]
5) libhdf5-10 [未安装]
6) liblapack3 [未安装]
7) libnetcdf11 [未安装]
8) mysql-workbench [未安装]
9) python-mysql.connector [未安装]

接受此解决方案吗?[Y/n/q/?] n 以下操作将解决这些依赖关系:

  Remove the following packages:                                           

1) 构建必需
2) g++
3) g++-5
4) gcc
5) gcc-5
6) libasan2
7) libatomic1
8) libcilkrts5
9) libgcc-5-dev
10) libitm1
11) liblsan0
12) libmpx0
13) libstdc++-5-dev
14) libtsan0
15) libubsan0

  Install the following packages:                                          

16)mysql-utilities [1.6.1-2 (xenial)]
17)tcc [0.9.27~git20151227.933c223-1 (xenial)]

  Keep the following packages at their current version:                    

18)mysql-connector-python [未安装]

  Downgrade the following packages:                                        

19) cpp-5 [5.4.0-6ubuntu1~16.04.1 (现在) -> 5.3.1-14ubuntu2 (xenial)]
20) gcc-5-base [5.4.0-6ubuntu1~16.04.1 (现在) -> 5.3.1-14ubuntu2 (xenial)]
21) libcc1-0 [5.4.0-6ubuntu1~16.04.1 (现在) -> 5.3.1-14ubuntu2 (xenial)]
22) libgomp1 [5.4.0-6ubuntu1~16.04.1 (现在) -> 5.3.1-14ubuntu2 (xenial)]
23) libquadmath0 [5.4.0-6ubuntu1~16.04.1 (现在) -> 5.3.1-14ubuntu2 (xenial)] 24) libstdc++6 [5.4.0-6ubuntu1~16.04.1 (现在) -> 5.3.1-14ubuntu2 (xenial)]

  Leave the following dependencies unresolved:                             

25) dpkg-dev 推荐 build-essential

接受这个解决方案吗?[Y/n/q/?] 以下软件包将被降级:cpp-5 gcc-5-base libcc1-0 libgomp1 libquadmath0 libstdc++6

答案3

在 Ubuntu 19 上

1)我必须在 Ubuntu 19 上手动安装一个库 libziphttps://ubuntu.pkgs.org/18.10/ubuntu-universe-amd64/libzip4_1.1.2-1.1_amd64.deb.html

2)然后在下载页面上手动选择mysql workbench的deb包https://dev.mysql.com/downloads/workbench/

然后通过标准 apt 安装程序在下载目录中安装 deb 包

sudo apt install ./libzip4_1.1.2-1.1_amd64.deb

并下载了工作台 deb 包

sudo apt install ./mysql-workbench-community_8.0.16-1ubuntu18.04_amd64.deb

答案4

对我来说,它只是在安装软件包之前sudo apt-get upgradesudo apt-get update命令之后运行。把它留在这里,以便将来可能遇到同样问题的人使用!

相关内容