8
7

Delete article

Deleted articles cannot be recovered.

Draft of this article would be also deleted.

Are you sure you want to delete this article?

More than 5 years have passed since last update.

[小ネタ]yumでupdate出来ないのはversionlockが悪かった話

Posted at

とあるサーバーでとあるパッケージだけyum updateができず、なんでやーとなった話です。

結論

  • 誰かがyum pluginのversionlockを導入し、対象のrpmのバージョンのロックを指定していたために発生していた
  • versionlockが導入されている場合、yumコマンド実行時にLoaded plugins: versionlockと表示されるのでその場合、本事象を疑ったほうが良い

事象

  • yum update hogeと実行してもパッケージのupdateができない
  • yum search hogeしても検索できない
  • ただし、他同様のサーバー環境ではyum search hogeとすると該当するのが存在する。また同様にyum install hogeでインストール可能

解決するまで

問題を整理するために他の環境でyumを使っときと問題の環境でyumを実施した時の差分を検証してみたのですが、その際に少し違いが

# yum installできる環境
$yum search hoge
Loaded plugins: fastestmirror, security

# yum installできない環境
$yum search hoge
Loaded plugins: priorities, update-motd, upgrade-helper, versionlock

!?

何かyumのLoaded pluginsが違う。。。
vesionlockとかあやしすぎる。。。

ということで確認。

yum plugin 「versionlock」の導入

yumのまとめ - 3.yumプラグインの説明とインストール手順

なるほど。 /etc/yum/pluginconf.d/versionlock.listというファイルにパッケージとバージョンを書いておくとそれで固定されると。

というわけで問題のサーバーで確認するとビンゴでupdateできないパッケージのバージョン情報がロックされており、それが原因でyum installができませんでした。

versionlockしている場合でも、yum searchは出来るようにするとかyum installとした時もversionlockによって出来ません、みたいなメッセージが出てくれれば良いのですが、何もメッセージが出ない(あたかもリポジトリに対象パッケージが内容に見える)のではまると中々分かりにくそうな印象。。。

試してないですが、debug実行すると何かでるのかなぁ。。。

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

Delete article

Deleted articles cannot be recovered.

Draft of this article would be also deleted.

Are you sure you want to delete this article?