Steve Gooberman-Hill
Steve Gooberman-Hill

Reputation: 513

mariadb with rails: can't install libmysqlclient-dev

I have mariadb-10.1 installed on a stock 64bit Ubuntu 15:10.

I have libmysqlclient18 succesfully installed, but I get errors when trying to install libmysqlclient-dev.

steve@steve:~$ dpkg -s libmysqlclient18
Package: libmysqlclient18
Status: install ok installed
Priority: optional
Section: libs
Installed-Size: 10
Maintainer: MariaDB Developers <[email protected]>
Architecture: amd64
Source: mariadb-10.1
Version: 10.1.13+maria-1~wily
Replaces: libmysqlclient18 (<< 10.1.13+maria-1~wily)
Depends: libmariadbclient18 (= 10.1.13+maria-1~wily)
Description: Virtual package to satisfy external depends
 This is an empty package that provides an updated "best" version of
 libmysqlclient18 that does not conflict with the libmariadbclient18
 package.
 .
 MariaDB is a fast, stable and true multi-user, multi-threaded SQL database
 server. SQL (Structured Query Language) is the most popular database query
 language in the world. The main goals of MariaDB are speed, robustness and
 ease of use.
Homepage: http://mariadb.org/
steve@steve:~$ sudo apt-get install libmysqlclient-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.
 libmysqlclient-dev : Depends: libmysqlclient18 (= 5.6.28-0ubuntu0.15.10.1)                  but 10.1.13+maria-1~wily is to be installed
E: Unable to correct problems, you have held broken packages.

Can anyone suggest how to resolve this?

Thanks :-)

Steve

Upvotes: 7

Views: 9015

Answers (2)

baptiste00001
baptiste00001

Reputation: 23

While installing libmariadbd-dev or libmariadbclient-dev package is the easiest way, in some OS's or package managers it is not available.

For example on a mac with homebrew this is not available, I found a workaround though.

To install gem mysql2 on a mac you need mariadb-connector-c in homebrew. This package conflicts with Mariadb symlinks so you need to do run the following in the terminal:

brew unlink mariadb
brew install mariadb-connector-c

Inside the rails project directory, execute: bundle install (or gem install mysql2)

brew uninstall mariadb-connector-c
brew link mariadb

Upvotes: 0

wisnia
wisnia

Reputation: 656

You have to install libmariadbclient-dev instead of libmysqlclient-dev when using MariaDB

sudo apt-get install libmariadbclient-dev

Upvotes: 11

Related Questions