LoginSignup
4
4

More than 5 years have passed since last update.

yum で phpMyAdmin をインストールするときのバージョン違いによるエラー

Posted at

なにが起きたか

先日、CentOS の GUI 環境でクリックが効かないなどの不具合が発生したため、GNOME の再インストールなどを行いました。
おそらくそのタイミングで phpMyAdmin など一部のプログラムも一緒にアンインストールされてしまったようだったので、インストールし直していました。

そこで発生したエラーと解決方法を備忘録としてメモします。

エラー内容

phpMyAdmin が消えてしまっていたので yum install しようとしたのですが、そこでエラーが発生。

$ yum --enablerepo=remi install phpmyadmin
読み込んだプラグイン:fastestmirror, langpacks
Loading mirror speeds from cached hostfile
 * base: ftp-srv2.kddilabs.jp
 * epel: ftp.riken.jp
 * extras: ftp-srv2.kddilabs.jp
 * remi: ftp.riken.jp
 * remi-safe: ftp.riken.jp
 * updates: ftp-srv2.kddilabs.jp
remi                                                                                                                                                                   | 3.0 kB  00:00:00     
依存性の解決をしています

## 略 ##

エラー: パッケージ: php-intl-5.4.45-16.el7.remi.x86_64 (remi)
             要求: php-common(x86-64) = 5.4.45-16.el7.remi
            インストール: php-common-7.2.4-1.el7.remi.x86_64 (@remi-php72)
                php-common(x86-64) = 7.2.4-1.el7.remi
            利用可能: php-common-5.4.16-46.el7.x86_64 (base)
                php-common(x86-64) = 5.4.16-46.el7
            利用可能: php-common-5.4.45-15.el7.remi.x86_64 (remi)
                php-common(x86-64) = 5.4.45-15.el7.remi
            利用可能: php-common-5.4.45-16.el7.remi.x86_64 (remi)
                php-common(x86-64) = 5.4.45-16.el7.remi
エラー: パッケージ: php-gd-5.4.45-16.el7.remi.x86_64 (remi)
             要求: php-common(x86-64) = 5.4.45-16.el7.remi
            インストール: php-common-7.2.4-1.el7.remi.x86_64 (@remi-php72)
                php-common(x86-64) = 7.2.4-1.el7.remi
            利用可能: php-common-5.4.16-46.el7.x86_64 (base)
                php-common(x86-64) = 5.4.16-46.el7
            利用可能: php-common-5.4.45-15.el7.remi.x86_64 (remi)
                php-common(x86-64) = 5.4.45-15.el7.remi
            利用可能: php-common-5.4.45-16.el7.remi.x86_64 (remi)
                php-common(x86-64) = 5.4.45-16.el7.remi
エラー: パッケージ: php-twig-1.35.4-1.el7.remi.5.4.x86_64 (remi)
             要求: php(zend-abi) = 20100525-64
            インストール: php-common-7.2.4-1.el7.remi.x86_64 (@remi-php72)
                php(zend-abi) = 20170718-64
            利用可能: php-common-5.4.16-46.el7.x86_64 (base)
                php(zend-abi) = 20100525-64
            利用可能: php-common-5.4.45-15.el7.remi.x86_64 (remi)
                php(zend-abi) = 20100525-64
            利用可能: php-common-5.4.45-16.el7.remi.x86_64 (remi)
                php(zend-abi) = 20100525-64

## 略 ##

原因

エラー の箇所を見てみると、5系バージョンを要求しているのに対し、7系バージョンをインストールしようとしています。

/etc/yum.repos.d を見てみるとバージョン違いの PHP リポジトリが複数存在していました。

-rw-r--r-- 1 root root 1664 11月 23 22:16 CentOS-Base.repo
-rw-r--r-- 1 root root 1309 11月 23 22:16 CentOS-CR.repo
-rw-r--r-- 1 root root  649 11月 23 22:16 CentOS-Debuginfo.repo
-rw-r--r-- 1 root root  630 11月 23 22:16 CentOS-Media.repo
-rw-r--r-- 1 root root 1331 11月 23 22:16 CentOS-Sources.repo
-rw-r--r-- 1 root root 5701 11月 23 22:16 CentOS-Vault.repo
-rw-r--r-- 1 root root  314 11月 23 22:16 CentOS-fasttrack.repo
-rw-r--r-- 1 root root 1050 10月  3  2017 epel-testing.repo
-rw-r--r-- 1 root root  951 10月  3  2017 epel.repo
-rw-r--r-- 1 root root 1885  4月 27  2017 mysql-community-source.repo
-rw-r--r-- 1 root root 1838  4月 27  2017 mysql-community.repo
-rw-r--r-- 1 root root   99  4月  4  2018 nginx.repo
-rw-r--r-- 1 root root  446  6月 19 17:28 remi-glpi91.repo
-rw-r--r-- 1 root root  446  6月 19 17:28 remi-glpi92.repo
-rw-r--r-- 1 root root  446  6月 19 17:28 remi-glpi93.repo
-rw-r--r-- 1 root root  456  6月 19 17:28 remi-php54.repo
-rw-r--r-- 1 root root 1314  6月 19 17:28 remi-php70.repo
-rw-r--r-- 1 root root 1314  6月 19 17:28 remi-php71.repo
-rw-r--r-- 1 root root 1314  6月 19 17:28 remi-php72.repo
-rw-r--r-- 1 root root 1314  6月 19 17:28 remi-php73.repo
-rw-r--r-- 1 root root  750  6月 19 17:28 remi-safe.repo
-rw-r--r-- 1 root root 2605 12月 18 16:58 remi.repo
-rw-r--r-- 1 root root  164 12月 17 12:05 vscode.repo

インストールするときに remi-php54.repo を見に行ってしまっていたようです。

解決策

要求している7系 PHP のリポジトリを見てもらうようにリポジトリを指定します。

yum --enablerepo=remi-php72 install phpmyadmin

これで解決しました。

4
4
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
4
4