mysql2 gem 安装失败,依赖项未满足:libmysqlclient-dev
mysql2 gem install fails with unmet dependencies: libmysqlclient-dev
我遇到了与 this poster on the askubuntu forums. I've started with a clean Ubuntu 14.04 install several times now and keep getting the same error no matter what I do 类似的问题。
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.
重现错误:
已按照 MariaDB site 上 10.0 版的说明进行操作。我在之前的尝试中也尝试过 10.1。
我的服务器上安装了 Ruby (2.2.3) on Rails (4.2.5)。设置我的应用程序,配置 Gemfile
和 bundle install
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.
然后我 gem install mysql2 -v '0.4.2'
得到以下内容:
mysql client is missing. You may need to 'apt-get install libmysqlclient-dev' or 'yum install mysql-devel', and try again.
所以我 apt-get install libmysqlclient-dev
并得到错误 Unable to correct problems, you have held broken packages
,如本 post 的第一部分所示。
信息:
apt-cache policy libmysqlclient18 &
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
我缺少哪一步可以使捆绑包安装不会遇到 mysql2 gem 的问题(并且仍然使用 MariaDB)? mysql -uroot -p
从终端运行正常。
purge
所有 mysql 相关包
sudo apt-get remove --purge mysql*
sudo apt-get autoremove
sudo apt-get autoclean
sudo apt-get update
现在,您有了一个干净的系统。再次尝试安装 mariadb
sudo apt-get install mariadb-server libmariadbclient-dev mariadb-client mysql-common libmysqlclient18 libmariadbd-dev
只需确保提示您安装的软件包版本与本页给出的版本相同:
http://ftp.yz.yamagata-u.ac.jp/pub/dbms/mariadb/repo/10.0/ubuntu/pool/main/m/mariadb-10.0/
否则,它会从 Ubuntu 的官方仓库安装 Mysql 包,这将导致 conflict.If 发生,您应该设置 maria db 仓库更高的优先级,如这一页:
https://askubuntu.com/questions/293619/assign-higher-priority-to-ppa
希望对你有帮助
我遇到了与 this poster on the askubuntu forums. I've started with a clean Ubuntu 14.04 install several times now and keep getting the same error no matter what I do 类似的问题。
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.
重现错误:
已按照 MariaDB site 上 10.0 版的说明进行操作。我在之前的尝试中也尝试过 10.1。
我的服务器上安装了 Ruby (2.2.3) on Rails (4.2.5)。设置我的应用程序,配置
Gemfile
和bundle install
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.
然后我
gem install mysql2 -v '0.4.2'
得到以下内容:mysql client is missing. You may need to 'apt-get install libmysqlclient-dev' or 'yum install mysql-devel', and try again.
所以我
apt-get install libmysqlclient-dev
并得到错误Unable to correct problems, you have held broken packages
,如本 post 的第一部分所示。
信息:
apt-cache policy libmysqlclient18 &
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
我缺少哪一步可以使捆绑包安装不会遇到 mysql2 gem 的问题(并且仍然使用 MariaDB)? mysql -uroot -p
从终端运行正常。
purge
所有 mysql 相关包
sudo apt-get remove --purge mysql*
sudo apt-get autoremove
sudo apt-get autoclean
sudo apt-get update
现在,您有了一个干净的系统。再次尝试安装 mariadb
sudo apt-get install mariadb-server libmariadbclient-dev mariadb-client mysql-common libmysqlclient18 libmariadbd-dev
只需确保提示您安装的软件包版本与本页给出的版本相同: http://ftp.yz.yamagata-u.ac.jp/pub/dbms/mariadb/repo/10.0/ubuntu/pool/main/m/mariadb-10.0/
否则,它会从 Ubuntu 的官方仓库安装 Mysql 包,这将导致 conflict.If 发生,您应该设置 maria db 仓库更高的优先级,如这一页: https://askubuntu.com/questions/293619/assign-higher-priority-to-ppa
希望对你有帮助