LoginSignup
3
9

More than 5 years have passed since last update.

リポジトリが壊れてPHPアップデートが出来なくなった時の対処方

Last updated at Posted at 2017-03-12

症状

Vagrant上のCentOS6.5のPHPを7系にしようと思って、epel と remi 入れて yum install したらこんなエラーが出てひえーってなりました。

yum install --enablerepo=remi,remi-php70 php
..(省略)..
Error: xz compression not available

うっそん…。
調べてみると、どうやらリポジトリが壊れているらしいとのこと。

原因

確かにね、CentOS6系なのにこれ叩いちゃったので、多分これが原因だと思います。

rpm -Uvh https://dl.fedoraproject.org/pub/epel/epel-release-latest-7.noarch.rpm

対処方

結論から言うと、

1.キャッシュ削除
2.epel と remi 削除
3.入れ直す

これで治りました。

手順

1.キャッシュ削除

これしないとね、epelとremi消してもさっきのエラー出たまんまだったんですよ。
なのでこれ最初にします。

rm -rf /var/cache/yum/x86_64/6/epel

2.epel と remi 削除

yum remove epel-release

これでremiもろとも消してくれました。

3.入れ直す

rpm -Uvh https://dl.fedoraproject.org/pub/epel/epel-release-latest-6.noarch.rpm
rpm -Uvh http://rpms.famillecollet.com/enterprise/remi-release-6.rpm

4.で、PHP入れてみる

yum install --enablerepo=remi,remi-php70 php
..(省略)..
Complete!
php -v
PHP 7.0.16 (cli) (built: Feb 14 2017 17:31:34) ( NTS )

入った!
よかった…。

参考

http://qiita.com/Kuragasaki/items/847db63febd8e16456ab
http://serverfault.com/questions/675802/xz-compression-not-available-yum-error-on-centos

3
9
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
3
9