title: mysql2 gem install fails with unmet dependencies: libmysqlclient-dev
body: <p>I am experiencing a similar issue to <a href="https://askubuntu.com/questions/667543/how-do-you-fix-unmet-dependencies-but-something-is-to-be-installed-error">this poster on the askubuntu forums</a>. I've started with a clean Ubuntu 14.04 install several times now and keep getting the same error no matter <a href="https://stackoverflow.com/questions/17932972/installing-mariadb-unmet-dependencies-mariadb-server-10-0">what I do</a>.</p>
  
  <pre><code>The following packages have unmet dependencies:
   libmysqlclient-dev : Depends: libmysqlclient18 (= 5.5.46-0ubuntu0.14.04.2) but 10.0.23+maria-1~trusty is to be installed
  E: Unable to correct problems, you have held broken packages.
  </code></pre>
  
  <p>Reproducing the error:</p>
  
  <ol>
  <li><p>Followed the instructions on the <a href="https://downloads.mariadb.org/mariadb/repositories/#mirror=digitalocean-nyc&amp;distro=Ubuntu&amp;distro_release=trusty--ubuntu_trusty&amp;version=10.0" rel="nofollow noreferrer">MariaDB site</a> for version 10.0. I tried 10.1 as well in a previous attempt.</p></li>
  <li><p>I have Ruby (2.2.3) on Rails (4.2.5) installed on my server. Setup my app, configure the <code>Gemfile</code> and <code>bundle install</code></p>
  
  <pre><code>An error occurred while installing mysql2 (0.4.2), and Bundler cannot continue.
      Make sure that `gem install mysql2 -v '0.4.2'` succeeds before bundling.
  </code></pre></li>
  <li><p>Then I <code>gem install mysql2 -v '0.4.2'</code> and get the following:</p>
  
  <pre><code>mysql client is missing. You may need to 'apt-get install libmysqlclient-dev' or 'yum install mysql-devel', and try again.
  </code></pre></li>
  <li><p>So I <code>apt-get install libmysqlclient-dev</code> and get the error <code>Unable to correct problems, you have held broken packages</code> as seen in the first part of this post.</p></li>
  </ol>
  
  <p>Infos:</p>
  
  <pre><code>apt-cache policy libmysqlclient18 &amp; 
  
   libmysqlclient18:
    Installed: 10.0.23+maria-1~trusty
    Candidate: 10.0.23+maria-1~trusty
    Version table:
   *** 10.0.23+maria-1~trusty 0
          500 http://sfo1.mirrors.digitalocean.com/mariadb/repo/10.0/ubuntu/ trusty/main amd64 Packages
          100 /var/lib/dpkg/status
       5.5.46-0ubuntu0.14.04.2 0
          500 http://mirrors.digitalocean.com/ubuntu/ trusty-updates/main amd64 Packages
          500 http://security.ubuntu.com/ubuntu/ trusty-security/main amd64 Packages
       5.5.35+dfsg-1ubuntu1 0
          500 http://mirrors.digitalocean.com/ubuntu/ trusty/main amd64 Packages
  </code></pre>
  
  <p>What step am I missing that will get the bundle install to not encounter issues with the mysql2 gem (and still use MariaDB)? <code>mysql -uroot -p</code> works okay from the terminal.</p>