リポジトリを指定してyum installする
サーバーにライブラリ(php-mysql)を入れようとしたら次のようなエラーが出た
Error: Missing Dependency: php-common = 5.1.6-34.el5_8 is needed by package php-mysql-5.1.6-34.el5_8.i386 (updates)
結論としては取得元のリポジトリが異なっていたから。
調べたメモを載せておく。
過程
yumでphp-mysqlを入れようとする
- コマンド
# sudo yum install php-mysql
- 実行結果(エラー)
# sudo yum install php-mysql Loaded plugins: fastestmirror Loading mirror speeds from cached hostfile * base: rsync.atworks.co.jp * extras: rsync.atworks.co.jp * rpmforge: ftp.riken.jp * updates: ftp.riken.jp Setting up Install Process Resolving Dependencies --> Running transaction check ---> Package php-mysql.i386 0:5.1.6-34.el5_8 set to be updated --> Processing Dependency: php-common = 5.1.6-34.el5_8 for package: php-mysql --> Finished Dependency Resolution php-mysql-5.1.6-34.el5_8.i386 from updates has depsolving problems --> Missing Dependency: php-common = 5.1.6-34.el5_8 is needed by package php-mysql-5.1.6-34.el5_8.i386 (updates) Error: Missing Dependency: php-common = 5.1.6-34.el5_8 is needed by package php-mysql-5.1.6-34.el5_8.i386 (updates) You could try using --skip-broken to work around the problem You could try running: package-cleanup --problems package-cleanup --dupes rpm -Va --nofiles --nodigest The program package-cleanup is found in the yum-utils package. #
言われた通りにtryしてみる
# sudo yum install --skip-broken php-mysql
だめだった。
php-commonがないのかと思い確認する
- yumの確認
# yum list installed | grep php php.i386 5.2.17-jason.2 installed php-cli.i386 5.2.17-jason.2 installed php-common.i386 5.2.17-jason.2 installed php-devel.i386 5.2.17-jason.2 installed php-mbstring.i386 5.2.17-jason.2 installed
入ってるじゃんと勘違いする。
このphp-commonは上記エラーのとリポジトリが違う(jason)のだけど、最初は分からなかった。
- 一応rpmでも
# rpm -qa | grep php php-5.2.16-jason.1 php-common-5.2.16-jason.1 php-mbstring-5.2.16-jason.1 php-xml-5.2.16-jason.1 php-pear-1.9.1-1.jason.1 php-devel-5.2.16-jason.1 php-cli-5.2.16-jason.1 php-pdo-5.2.16-jason.1
いろいろと調べてみる
似たような現象を見つける。
0005711: Missing Dependency: php-common - CentOS Bug Tracker
your problem is that you're using PHP packages not provided by CentOS. That can be seen from the 'rpm -qa' output where it shows package names ending with remi. Those are not CentOS packages.
ここにきてやっと、サーバーに入っているphpの参照リポジトリがデフォルトとは違うんじゃないかと気付く。
リポジトリ別のパッケージ一覧を確認。
UtterramblingsとremiとepelでのPHPのパッケージの充実度の違い - rysk92wiki
リポジトリ指定してtry
# sudo yum --enablerepo=utterramblings install php-mysql
OK!!
# yum list installed | grep php php.i386 5.2.17-jason.2 installed php-cli.i386 5.2.17-jason.2 installed php-common.i386 5.2.17-jason.2 installed php-devel.i386 5.2.17-jason.2 installed php-mbstring.i386 5.2.17-jason.2 installed php-mysql.i386 5.2.17-jason.2 installed
自宅ではリポジトリとか意識しないでデフォルトのまま使っていたから、
原因に気付くのにちょっと手間取った。
ひとつ勉強になった。