yum updateから特定のリポジトリを外す

少し前にサーバマシンを変更しましたが、その後大きな問題もなくBLOGサーバ、SSHサーバとしての機能を果たしてくれているようで一安心(ファイルサーバの構築はこれからですが)。
と思ったら。

# yum update
読み込んだプラグイン:fastestmirror, refresh-packagekit, security
更新処理の設定をしています
Determining fastest mirrors
epel/metalink | 14 kB 00:00base: ftp.iij.ad.jp
epel: mirrors.ukfast.co.uk
extras: ftp.iij.ad.jp
remi-safe: ftp.riken.jp
updates: ftp.iij.ad.jp
adobe-linux-x86_64 | 2.9 kB 00:00
base | 3.7 kB 00:00
epel | 4.7 kB 00:00
epel/primary_db | 6.1 MB 02:20
extras | 3.4 kB 00:00
mysql-connectors-community | 2.5 kB 00:00
mysql-tools-community | 2.5 kB 00:00
mysql57-community | 2.5 kB 00:00
remi-safe | 3.0 kB 00:00
remi-safe/primary_db | 1.2 MB 00:09
updates | 3.4 kB 00:00
依存性の解決をしています
–> トランザクションの確認を実行しています。
 ・
 ・
 ・
–> 依存性解決を終了しました。
エラー: パッケージ: php-mbstring-7.3.15-1.el6.remi.x86_64 (@remi-php73)
要求: libonig.so.5()(64bit)
削除: oniguruma5-6.9.5+rev1-1.el6.remi.x86_64 (@remi-safe)
libonig.so.5()(64bit)
次のものにより不要にされた: : oniguruma5php-6.9.5+rev1-2.el6.remi.x86_64 (remi-safe)
見つかりません
問題を回避するために –skip-broken を用いることができません
これらを試行できます: rpm -Va –nofiles –nodigest

んおっ!?
なんとエラーが返されてしまいました。

どうやらremi-php73(これはwordpressを動作させるのに必須だったはず)が必要としているパッケージのlibonig.so.5()を、remi-safeのoniguruma5-6.9.5+rev1-1.el6.remi.x86_64パッケージが削除しようとしていて依存性が解決できないっぽい?
いずれにしてもphp7.3は必要なはずなので、ここはremi-safeリポジトリをyum updateから除外することで対応することにします(参照先)。

まずは現在の状況確認。

# yum repolist all
読み込んだプラグイン:fastestmirror, refresh-packagekit, security
Loading mirror speeds from cached hostfile
base: ftp.iij.ad.jp
epel: mirrors.ukfast.co.uk
extras: ftp.iij.ad.jp
remi-safe: ftp.riken.jp
updates: ftp.iij.ad.jp
リポジトリー ID リポジトリー名 状態
 ・
 ・
 ・
remi-safe Safe Remi’s RPM repository for Enterprise Linux 6 – x86_64 有効: 2,938

一部抜粋ですが、やっぱりremi-safeが有効になっています。これを停止して、先ほどのパッケージが上書きされないようにしてみることにします。

# cd /etc/yum.repos.d/
# ls
CentOS-Base.repo adobe-linux-x86_64.repo remi-glpi91.repo remi-php70.repo remi.repo
CentOS-Debuginfo.repo epel-testing.repo remi-glpi92.repo remi-php71.repo
CentOS-Media.repo epel.repo remi-glpi93.repo remi-php72.repo
CentOS-Vault.repo mysql-community-source.repo remi-glpi94.repo remi-php73.repo
CentOS-fasttrack.repo mysql-community.repo remi-php54.repo remi-safe.repo epel-testing.repo remi-glpi94.repo remi.repo

yumのリポジトリの一覧にremi-safe.repoがあることを確認したらこのファイル(中身はもちろんテキストです)を編集します。

# vi remi-safe.repo
This repository is safe to use with RHEL/CentOS base repository
it only provides additional packages for the PHP stack
all dependencies are in base repository or in EPEL
[remi-safe]
name=Safe Remi’s RPM repository for Enterprise Linux 6 – $basearch
baseurl=https://rpms.remirepo.net/enterprise/6/safe/$basearch/
mirrorlist=https://rpms.remirepo.net/enterprise/6/safe/httpsmirror
mirrorlist=https://cdn.remirepo.net/enterprise/6/safe/mirror
enabled=1
gpgcheck=1
gpgkey=file:///etc/pki/rpm-gpg/RPM-GPG-KEY-remi
[remi-safe-debuginfo]
name=Remi’s RPM repository for Enterprise Linux 6 – $basearch – debuginfo
baseurl=https://rpms.remirepo.net/enterprise/6/debug-remi/$basearch/
enabled=0
gpgcheck=1
gpgkey=file:///etc/pki/rpm-gpg/RPM-GPG-KEY-remi
remi-safe.repo (END)

このうち、[remi-safe]セクションにある「enabled = 1」がyum update時にそのリポジトリを有功にするための設定。この数値を0にすることでyum update時にリポジトリを無効にできます。
編集したら上書き保存をし、yum repolist allコマンドでリポジトリの状態を確認。

remi-safe Safe Remi’s RPM repository for Enterprise Linux 6 – x86_64 無効

となっていればOKです。
確認したら再度yum updateを実行。
今度は無事にyum updateが最後まで進み、アップデートが完了しました。

今回の過程で気がついたのですが、remi-php73.repoは有効になっていないんですよね。うちのサーバの現行PHPはこれなので、もしかしたらこいつは有効にして定期的にアップデートしたほうがいいんじゃないのかな・・・?
また時間が取れたときに、ちょっと設定を変更してみることにしましょう!

今回はここまで!(笑)

アバター画像

boota

いろんなモノに、いろんな意味で、ヲタ。なのかも?

コメントを残す

メールアドレスが公開されることはありません。 が付いている欄は必須項目です

日本語が含まれない投稿は無視されますのでご注意ください。(スパム対策)