CentOS6.10の環境で、Remiリポジトリを使ってPHP7.2へのアップデートを試みた際、エラーが発生しました。エラー発生時の対応も含めて手順をまとめました。
※目次をクリックすると目次の下部にコンテンツが表示されます。
PHPバージョンアップに伴う変更点
エラー発生時の状況
①Remiリポジトリの確認
# ls -al /etc/yum.repos.d/ : : -rw-r--r-- 1 root root 456 Feb 18 2020 remi-php54.repo -rw-r--r-- 1 root root 1314 Feb 18 2020 remi-php70.repo -rw-r--r-- 1 root root 1314 Feb 18 2020 remi-php71.repo -rw-r--r-- 1 root root 1314 Feb 18 2020 remi-php72.repo -rw-r--r-- 1 root root 1314 Feb 18 2020 remi-php73.repo
②yumコマンドでアップデート→エラー発生
# yum update --enablerepo=remi,remi-php72 php php-devel php-mbstring php-pdo php-mysql : : YumRepo Error: All mirror URLs are not using ftp, http[s] or file. Eg. Invalid release/repo/arch combination/ removing mirrorlist with no valid mirrors: /var/cache/yum/x86_64/6/base/mirrorlist.txt Error: Cannot find a valid baseurl for repo: base
エラー回避の方法
①エラー回避の方法
# echo "https://vault.centos.org/6.10/os/x86_64/" > /var/cache/yum/x86_64/6/base/mirrorlist.txt # echo "https://vault.centos.org/6.10/extras/x86_64/" > /var/cache/yum/x86_64/6/extras/mirrorlist.txt # echo "https://vault.centos.org/6.10/updates/x86_64/" > /var/cache/yum/x86_64/6/updates/mirrorlist.txt
②再度アップデートコマンド実行
# yum update --enablerepo=remi,remi-php72 php php-devel php-mbstring php-pdo php-mysql Dependencies Resolved ================================================================================ Package Arch Version Repository Size ================================================================================ Installing: php-pecl-mcrypt x86_64 1.0.3-1.el6.remi.7.2 remi-php72 26 k replacing php-mcrypt.x86_64 7.1.12-4.el6.remi Updating: php x86_64 7.2.34-1.el6.remi remi-php72 3.0 M php-devel x86_64 7.2.34-1.el6.remi remi-php72 1.4 M php-mbstring x86_64 7.2.34-1.el6.remi remi-php72 840 k php-mysqlnd x86_64 7.2.34-1.el6.remi remi-php72 215 k php-pdo x86_64 7.2.34-1.el6.remi remi-php72 116 k Installing for dependencies: libargon2 x86_64 20161029-7.el6.remi remi 21 k libargon2-devel x86_64 20161029-7.el6.remi remi 12 k libedit-devel x86_64 2.11-4.20080712cvs.1.el6 base 26 k oniguruma5php x86_64 6.9.6-1.el6.remi remi 199 k Updating for dependencies: php-bcmath x86_64 7.2.34-1.el6.remi remi-php72 71 k php-cli x86_64 7.2.34-1.el6.remi remi-php72 4.3 M php-common x86_64 7.2.34-1.el6.remi remi-php72 1.1 M php-gd x86_64 7.2.34-1.el6.remi remi-php72 77 k php-gmp x86_64 7.2.34-1.el6.remi remi-php72 66 k php-json x86_64 7.2.34-1.el6.remi remi-php72 65 k php-pecl-ssh2 x86_64 1.2-1.el6.remi.7.2 remi-php72 41 k php-pecl-zip x86_64 1.19.2-1.el6.remi.7.2 remi-php72 54 k php-process x86_64 7.2.34-1.el6.remi remi-php72 72 k php-recode x86_64 7.2.34-1.el6.remi remi-php72 48 k php-tidy x86_64 7.2.34-1.el6.remi remi-php72 63 k php-xml x86_64 7.2.34-1.el6.remi remi-php72 181 k Transaction Summary ================================================================================ : : Complete!
③アップデート後のバージョン確認
# php -v PHP 7.2.34 (cli) (built: Sep 30 2020 07:39:53) ( NTS ) Copyright (c) 1997-2018 The PHP Group Zend Engine v3.2.0, Copyright (c) 1998-2018 Zend Technologies