'Dependency error while installing mysql workbench on ubuntu 12.04

I am trying to install mysql workbench. I am getting below error. It seems that it looks for mysql in some default directory. I have all the required things installed, but not where mysqlworkbench is expecting it to be. Whats the way out!

local@host:/var/www/$ sudo apt-get -f install mysql-workbench
Reading package lists... Done
Building dependency tree       
Reading state information... Done
You might want to run 'apt-get -f install' to correct these:
The following packages have unmet dependencies:
 mysql-workbench : Depends: libctemplate0 but it is not going to be installed
                   Depends: libgtkmm-2.4-1c2a (>= 1:2.24.0) but it is not going to be installed
                   Depends: libmysqlclient18 (>= 5.5.13-1) but it is not going to be installed
                   Depends: libtinyxml2.6.2 but it is not going to be installed
                   Depends: libzip2 (>= 0.10) but it is not going to be installed
                   Depends: mysql-workbench-data (= 5.2.38+dfsg-3) but it is not going to be installed
                   Depends: mysql-client
                   Depends: python-mysql.connector but it is not going to be installed
                   Depends: python-paramiko but it is not going to be installed
                   Depends: python-pysqlite2 but it is not going to be installed
                   Depends: python-all but it is not going to be installed
                   Recommends: ttf-bitstream-vera but it is not going to be installed
                   Recommends: mysql-utilities but it is not installable
 mysql-workbench-community : Depends: libctemplate2 but it is not installable
                             Depends: libglib2.0-0 (>= 2.35.9) but 2.32.3-0ubuntu1 is to be installed
                             Depends: libglibmm-2.4-1c2a (>= 2.33.13) but 2.32.0-0ubuntu1 is to be installed
                             Depends: libgtkmm-2.4-1c2a (>= 1:2.24.0) but it is not going to be installed
                             Depends: libmysqlclient18 (>= 5.5.13-1) but it is not going to be installed
                             Depends: libpcrecpp0 (>= 7.7) but it is not going to be installed
                             Depends: libtinyxml2.6.2 but it is not going to be installed
                             Depends: libzip2 (>= 0.10) but it is not going to be installed
                             Depends: python-paramiko but it is not going to be installed
                             Depends: mysql-client
                             Depends: python-pysqlite2 but it is not going to be installed
E: Unmet dependencies. Try 'apt-get -f install' with no packages (or specify a solution).


Solution 1:[1]

You probably ran

dpkg -i mysql-workbench.deb

which doesn't work as dpkg does not resolve dependencies and now the installation of MySQL Workbench is broken. Run this command instead:

sudo apt-get -f install

After that MySQL Workbench should be installed fine.

Also keep in mind that we provide downloads for Ubuntu (select Ubuntu Linux from the drop down).

Solution 2:[2]

Try installing again, let it fail and run the second command:

sudo apt-get -f install mysql-workbench
sudo apt --fix-broken install

That did the trick for me on a similar issue for me trying to install mysql 5.7 on ubuntu 18.04. The problem manifested in my machine because I first tried to install mysql with a DEB package and then I tried to install it from mysql's apt repository.

Solution 3:[3]

I faced same issue but the below method worked for me. sudo apt-get update then sudo apt-get install mysql-workbench use this link for more details - http://dev.mysql.com/doc/mysql-apt-repo-quick-guide/en/#apt-repo-fresh-install

Solution 4:[4]

If the error is : The following packages have unmet dependencies: mysql-workbench : Depends: gdal-abi-2-1-2 Updating the package tree will do nothing.

NOTE: this is a set of ideas to try (so the answer is incomplete but i think it can help some) [I didn't get the time to test all the options] (when i do i will update)

A solution is to download that package and install it from https://debian.pkgs.org/9/debian-main-amd64/libgdal20_2.1.2+dfsg-5_amd64.deb.html direct download link http://ftp.br.debian.org/debian/pool/main/g/gdal/libgdal20_2.1.2+dfsg-5_amd64.deb

sudo apt install ./libgdal20_2.1.2+dfsg-5_amd64.deb  # and that being in the download folder

Note that will downgrade libgdal20, at least in my case:

The following packages will be REMOVED:
  blender frei0r-plugins libopencv-calib3d3.2 libopencv-contrib3.2 libopencv-features2d3.2 libopencv-highgui3.2 libopencv-imgcodecs3.2
  libopencv-objdetect3.2 libopencv-stitching3.2 libopencv-superres3.2 libopencv-videoio3.2 libopencv-videostab3.2 libopencv-viz3.2 libopenimageio1.8
  libvtk6.3
The following NEW packages will be installed:
  libarmadillo7 libdap23 libnetcdf11 libproj12 libxerces-c3.1
The following packages will be DOWNGRADED:
  libgdal20

You can see here how many package are to be removed, blender one of them for me. So check if you want to do that. After that you should be good to install workbench (haven't tried it, just think it will work, i didn't want to uninstall blender).

Another way, which is not reassuring, is to install the latest version from the official website, getting the for ubuntu package. https://dev.mysql.com/downloads/workbench/. Installed it working fine up to now. You will get a message alerting about the system, and that errors may occur. You can choose to not see again the message.

And last way, installing from the source code, i don't have time currently, so i will update once it's done. I think this will be the best options, as a good way to learn new things. I will update and write a tutorial once i do it.

Solution 5:[5]

for me this command worked

sudo apt-get -f install ./mysql-workbench-community-dbgsym_8.0.28-1ubuntu20.04_amd64.deb

Solution 6:[6]

After the installation faild I use

sudo apt --fix-broken install

And all works as expected

Sources

This article follows the attribution requirements of Stack Overflow and is licensed under CC BY-SA 3.0.

Source: Stack Overflow

Solution Source
Solution 1 Mike Lischke
Solution 2 corlaez
Solution 3 Varshaan
Solution 4 Mohamed Allal
Solution 5 3bu1
Solution 6 Nerower