LoginSignup
0
2

More than 5 years have passed since last update.

Mysql/Mariadbのインストールが依存関係で失敗した時の対処方法@ubuntu16.04

Last updated at Posted at 2017-03-13

この記事の翻訳になりますが、ubuntu16.04でredmineをインストールしようとしてうまく行かないので諦めようとした時、mysql/mariadbが下記のエラーで死んだのでどうしたことやらと思っていた時に見つけたTips

再現方法

apt install redmine

エラー内容

su: No module specific data is present
`/var/www` is not writable.
Bundler will use `/tmp/user/33/bundler/home/www-data' as your home directory temporarily.

おそらくdependency packageとして何かが足りていない。
英語をそのまま訳すと、/var/wwwはwritableじゃないぜという感じ。
#後で調査して追記します。

mariadb-server (10.0.29-0ubuntu0.16.04.1) を展開しています...
systemd (229-4ubuntu16) のトリガを処理しています ...
ureadahead (0.100.0-19) のトリガを処理しています ...
man-db (2.7.5-1) のトリガを処理しています ...
libdbi-perl (1.634-1build1) を設定しています ...
libdbd-mysql-perl (4.033-1ubuntu0.1) を設定しています ...
libterm-readkey-perl (2.33-1build1) を設定しています ...
libaio1:amd64 (0.3.110-2) を設定しています ...
mariadb-client-core-10.0 (10.0.29-0ubuntu0.16.04.1) を設定しています ...
mariadb-client-10.0 (10.0.29-0ubuntu0.16.04.1) を設定しています ...
mariadb-server-core-10.0 (10.0.29-0ubuntu0.16.04.1) を設定しています ...
mariadb-server-10.0 (10.0.29-0ubuntu0.16.04.1) を設定しています ...
dpkg: パッケージ mariadb-server-10.0 の処理中にエラーが発生しました (--configure):
 サブプロセス インストール済みの post-installation スクリプト はエラー終了ステータス 1 を返しました
dpkg: 依存関係の問題により mariadb-server の設定ができません:
 mariadb-server は以下に依存 (depends) します: mariadb-server-10.0 (>= 10.0.29-0ubuntu0.16.04.1) ...しかし:
  パッケージ mariadb-server-10.0 はまだ設定されていません。

dpkg: パッケージ mariadb-server の処理中にエラーが発生しました (--configure):
 依存関係の問題 - 設定を見送ります
libc-bin (2.23-0ubuntu5) のトリガを処理しています ...
エラーメッセージは前の失敗から続くエラーであることを示しているので、レポートは書き込まれません。
                systemd (229-4ubuntu16) のトリガを処理しています ...
ureadahead (0.100.0-19) のトリガを処理しています ...
処理中にエラーが発生しました:
 mariadb-server-10.0
 mariadb-server

で、なんのエラーかというと
以前インストールしたmysqlのゴミ(depended package)が残っていた様子。
なので

不要パッケージの削除

dpkg -l | grep -i 'maria\|mysql' | awk '{print $2}' | xargs sudo apt-get purge

で依存関係を解決しつつ丁寧に消して行った結果うまく行った。

mysqlへのログイン


sudo -i
mysql -u root
`
して

mysqlへログイン、データベースの確認

root@sasukeh:~# mysql -u root
Welcome to the MariaDB monitor.  Commands end with ; or \g.
Your MariaDB connection id is 45
Server version: 10.0.29-MariaDB-0ubuntu0.16.04.1 Ubuntu 16.04

Copyright (c) 2000, 2016, Oracle, MariaDB Corporation Ab and others.

Type 'help;' or '\h' for help. Type '\c' to clear the current input statement.

MariaDB [(none)]> show databases;
+--------------------+
| Database           |
+--------------------+
| information_schema |
| mysql              |
| performance_schema |
+--------------------+
3 rows in set (0.00 sec)

MariaDB [(none)]> 

このくらいの確認作業は、しておきましょう。

0
2
0

Register as a new user and use Qiita more conveniently

  1. You get articles that match your needs
  2. You can efficiently read back useful information
  3. You can use dark theme
What you can do with signing up
0
2