4
2

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 3 years have passed since last update.

Dockerコンテナ内でyumコマンドが使用できない

Last updated at Posted at 2020-06-01

Dockerコンテナ内でyumを用いてインストールしようとしたら下記のようなエラーメッセージが表示された。(yumは入っていて、バージョンも表示される

$ bash-4.2# yum update
読み込んだプラグイン:ovl, priorities
amzn2-core                                            | 2.4 kB     00:00
http://packages.groonga.org/centos/2/x86_64/repodata/repomd.xml: [Errno 14] HTTP Error 404 - Not Found
他のミラーを試します。


 One of the configured repositories failed (Groonga for CentOS 2 - x86_64),
 and yum doesn't have enough cached data to continue. At this point the only
 safe thing yum can do is fail. There are a few ways to work "fix" this:

 1. Contact the upstream for the repository and get them to fix the problem.

 2. Reconfigure the baseurl/etc. for the repository, to point to a working
    upstream. This is most often useful if you are using a newer
    distribution release than is supported by the repository (and the
    packages for the previous distribution release still work).

 3. Run the command with the repository temporarily disabled
        yum --disablerepo=groonga ...

 4. Disable the repository permanently, so yum won't use it by default. Yum
    will then just ignore the repository until you permanently enable it
    again or use --enablerepo for temporary usage:

        yum-config-manager --disable groonga
    or
        subscription-manager repos --disable=groonga

 5. Configure the failing repository to be skipped, if it is unavailable.
    Note that yum will try to contact the repo. when it runs most commands,
    so will have to try and fail each time (and thus. yum will be be much
    slower). If it is a very temporary problem though, this is often a nice
    compromise:

        yum-config-manager --save --setopt=groonga.skip_if_unavailable=true

failure: repodata/repomd.xml from groonga: [Errno 256] No more mirrors to try.
http://packages.groonga.org/centos/2/x86_64/repodata/repomd.xml: [Errno 14] HTTP Error 404 - Not Found

ミラー内にページがないですよという旨のエラー。
キャッシュに古いurlが残って404を返されることもあるようなので、下記コマンドでキャッシュをクリアしたが改善しなかった。

$ yum clean metadata
$ yum clean all

ミラーとなるベースのページ設定を編集すれば解決した。

$ cd /etc/yum.reps.d
$ ls
amzn2-core.repo  groonga.repo

groonga.repoでエラーが出ていたのでこちらを編集する。(存在しているページを指定すればOK)

$ vi groonga.repo
[groonga]
~略~
baseurl=http://packages.groonga.org/centos/8/$basearch/
#baseurl=http://packages.groonga.org/centos/$releasever/$basearch/ コメントアウト
~略~

実行して成功するか確認する。

$ yum update
4
2
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
2

Delete article

Deleted articles cannot be recovered.

Draft of this article would be also deleted.

Are you sure you want to delete this article?