質問をすることでしか得られない、回答やアドバイスがある。

15分調べてもわからないことは、質問しよう!

新規登録して質問してみよう
ただいま回答率
85.48%
CentOS

CentOSは、主にRed Hat Enterprise Linux(RHEL)をベースにした、フリーのソフトウェアオペレーティングシステムです。

yum

yumコマンドは、UNIX系OSのRPMパッケージのインストールなどを行うためのプログラムのことです。

Q&A

解決済

3回答

33356閲覧

Cetnos7 yum が使えない

tony

総合スコア86

CentOS

CentOSは、主にRed Hat Enterprise Linux(RHEL)をベースにした、フリーのソフトウェアオペレーティングシステムです。

yum

yumコマンドは、UNIX系OSのRPMパッケージのインストールなどを行うためのプログラムのことです。

0グッド

0クリップ

投稿2018/04/20 04:58

Cetos7をVirtualBox上で動かして
yum update
yum install xxx
を試してみたところ
下記エラーが出力され、実行できません。

読み込んだプラグイン:fastestmirror base | 3.6 kB 00:00:00 extras | 3.4 kB 00:00:00 http://ftp.riken.jp/Linux/centos/7/updates/x86_64/repodata/repomd.xml: [Errno 12] Timeout on http://ftp.riken.jp/Linux/centos/7/updates/x86_64/repodata/repomd.xml: (28, 'Operation too slow. Less than 1000 bytes/sec transferred the last 30 seconds') 他のミラーを試します。 http://ftp.riken.jp/Linux/centos/7/updates/x86_64/repodata/repomd.xml: [Errno 12] Timeout on http://ftp.riken.jp/Linux/centos/7/updates/x86_64/repodata/repomd.xml: (28, 'Operation too slow. Less than 1000 bytes/sec transferred the last 30 seconds') 他のミラーを試します。 http://ftp.riken.jp/Linux/centos/7/updates/x86_64/repodata/repomd.xml: [Errno 12] Timeout on http://ftp.riken.jp/Linux/centos/7/updates/x86_64/repodata/repomd.xml: (28, 'Operation too slow. Less than 1000 bytes/sec transferred the last 30 seconds') 他のミラーを試します。 ・ ・ ・ 他のミラーを試します。 http://ftp.riken.jp/Linux/centos/7/updates/x86_64/repodata/repomd.xml: [Errno 12] Timeout on http://ftp.riken.jp/Linux/centos/7/updates/x86_64/repodata/repomd.xml: (28, 'Operation too slow. Less than 1000 bytes/sec transferred the last 30 seconds') 他のミラーを試します。 One of the configured repositories failed (CentOS-7 - Updates), 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=updates ... 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 updates or subscription-manager repos --disable=updates 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=updates.skip_if_unavailable=true failure: repodata/repomd.xml from updates: [Errno 256] No more mirrors to try. http://ftp.riken.jp/Linux/centos/7/updates/x86_64/repodata/repomd.xml: [Errno 12] Timeout on http://ftp.riken.jp/Linux/centos/7/updates/x86_64/repodata/repomd.xml: (28, 'Operation too slow. Less than 1000 bytes/sec transferred the last 30 seconds') http://ftp.riken.jp/Linux/centos/7/updates/x86_64/repodata/repomd.xml: [Errno 12] Timeout on http://ftp.riken.jp/Linux/centos/7/updates/x86_64/repodata/repomd.xml: (28, 'Operation too slow. Less than 1000 bytes/sec transferred the last 30 seconds') ・ ・ ・ ・ http://ftp.riken.jp/Linux/centos/7/updates/x86_64/repodata/repomd.xml: (28, 'Operation too slow. Less than 1000 bytes/sec transferred the last 30 seconds') http://ftp.riken.jp/Linux/centos/7/updates/x86_64/repodata/repomd.xml: [Errno 12] Timeout on http://ftp.riken.jp/Linux/centos/7/updates/x86_64/repodata/repomd.xml: (28, 'Operation too slow. Less than 1000 bytes/sec transferred the last 30 seconds')

[やってみたこと]
・DNSの設定 → 8.8.8.8
・デフォルトゲートウェイの設定
・CentOS-Base.repoを下記のようにbaseurlを変更後 yum clean all

# CentOS-Base.repo # # The mirror system uses the connecting IP address of the client and the # update status of each mirror to pick mirrors that are updated to and # geographically close to the client. You should use this for CentOS updates # unless you are manually picking other mirrors. # # If the mirrorlist= does not work for you, as a fall back you can try the # remarked out baseurl= line instead. # # [base] name=CentOS-$releasever - Base #mirrorlist=http://mirrorlist.centos.org/?release=$releasever&arch=$basearch&repo=os&infra=$infra #baseurl=http://mirror.centos.org/centos/$releasever/os/$basearch/ baseurl=http://ftp.riken.jp/Linux/centos/$releasever/os/$basearch/ gpgcheck=1 gpgkey=file:///etc/pki/rpm-gpg/RPM-GPG-KEY-CentOS-7 #released updates [updates] name=CentOS-$releasever - Updates #mirrorlist=http://mirrorlist.centos.org/?release=$releasever&arch=$basearch&repo=updates&infra=$infra #baseurl=http://mirror.centos.org/centos/$releasever/updates/$basearch/ baseurl=http://ftp.riken.jp/Linux/centos/$releasever/updates/$basearch/ gpgcheck=1 gpgkey=file:///etc/pki/rpm-gpg/RPM-GPG-KEY-CentOS-7 #additional packages that may be useful [extras] name=CentOS-$releasever - Extras #mirrorlist=http://mirrorlist.centos.org/?release=$releasever&arch=$basearch&repo=extras&infra=$infra #baseurl=http://mirror.centos.org/centos/$releasever/extras/$basearch/ baseurl=http://ftp.riken.jp/Linux/centos/$releasever/extras/$basearch/ gpgcheck=1 gpgkey=file:///etc/pki/rpm-gpg/RPM-GPG-KEY-CentOS-7 #additional packages that extend functionality of existing packages [centosplus] name=CentOS-$releasever - Plus #mirrorlist=http://mirrorlist.centos.org/?release=$releasever&arch=$basearch&repo=centosplus&infra=$infra #baseurl=http://mirror.centos.org/centos/$releasever/centosplus/$basearch/ baseurl=http://ftp.riken.jp/Linux/centos/$releasever/centosplus/$basearch/ gpgcheck=1 enabled=0 gpgkey=file:///etc/pki/rpm-gpg/RPM-GPG-KEY-CentOS-7

pingによるインターネットへの疎通は正常に行えます。

ping google.com PING google.com (216.58.199.238) 56(84) bytes of data. 64 bytes from kix05s02-in-f238.1e100.net (216.58.199.238): icmp_seq=1 ttl=54 time=8.46 ms 64 bytes from kix05s02-in-f238.1e100.net (216.58.199.238): icmp_seq=2 ttl=54 time=10.7 ms 64 bytes from kix05s02-in-f238.1e100.net (216.58.199.238): icmp_seq=3 ttl=54 time=4.84 ms ping yahoo.com PING yahoo.com (72.30.35.10) 56(84) bytes of data. 64 bytes from media-router-fp2.prod1.media.vip.bf1.yahoo.com (72.30.35.10): icmp_seq=1 ttl=44 time=189 ms 64 bytes from media-router-fp2.prod1.media.vip.bf1.yahoo.com (72.30.35.10): icmp_seq=2 ttl=44 time=187 ms 64 bytes from media-router-fp2.prod1.media.vip.bf1.yahoo.com (72.30.35.10): icmp_seq=3 ttl=44 time=187 ms

[環境]
・ホストOS Windows Server 2012 R2 Standard
・VirtualBox 5.2.8 [ブリッジ接続]
・ゲストOS CentOS Linux release 7.4.1708 (Core)

ご教示のほど宜しくお願い致します。

気になる質問をクリップする

クリップした質問は、後からいつでもMYページで確認できます。

またクリップした質問に回答があった際、通知やメールを受け取ることができます。

バッドをするには、ログインかつ

こちらの条件を満たす必要があります。

over

2018/04/20 06:20

proxyを経由しているとかないですか?
over

2018/04/20 06:23

すいません。言葉足りないと感じたので・・・ proxy経由制限がかかった環境ではありませんか?
tony

2018/04/20 10:24

proxy経由制限はしていないですね。。
over

2018/04/23 01:00

そもそも、ミラーサイトが参照できていないですね...何故だろう?ホストosのブラウザから該当urlには接続できますか?
tony

2018/04/23 01:13

ホストOSのブラウザからは参照可能でした。そしてcurl ftp://ftp.riken.jp/Linux/centos/7/updates/x86_64/repodata/repomd.xmlは通ったので、baseurlをftp://ftp.riken.jp/Linux/・・・・・・にすることによって問題解決(yum update成功)しました。。。何故!?
over

2018/04/23 01:23

もうちょっと噛み砕いた説明が欲しいところです。自己解決で回答していただけると助かります。
guest

回答3

0

自己解決

CentOS-Base.repoのbaseurlを
http://ftp.riken.jp/Linux/centos/$releasever/xxxx/$basearch/ではなく
ftp://ftp.riken.jp/Linux/centos/$releasever/xxxx/$basearch/にしたところ
とりあえずの問題解決。

[補足]
curl http://ftp.riken.jp/Linux/centos/ は失敗 curl: (52) Empty reply from server
curl http://ftp.riken.jp/Linux/ は成功
curl ftp://ftp.riken.jp/Linux/centos/ は成功
ホストOSのブラウザでhttp://ftp.riken.jp/Linux/centos/は表示可能

理研のサーバーがプロトコル(HTTP)ではじく仕様ならブラウザでも表示できないはず。。謎です。。。

[2018/04/24追記]
上記でもyumが正常に動作しないことがありました。
VirtualBoxのネットワーク設定をブリッジ接続からNATに変更したところ正常な動作を確認しました。
※CentOS-Base.repoの内容はすべて初期状態に戻しました。
ブリッジ接続により他の通信と干渉していたのか等々は現在追求中です。

投稿2018/04/23 01:27

編集2018/04/24 02:28
tony

総合スコア86

バッドをするには、ログインかつ

こちらの条件を満たす必要があります。

0

解決策ではありませんが、
updatesをenabled=0にしてみてください。

投稿2018/04/20 10:07

mkgrei

総合スコア8560

バッドをするには、ログインかつ

こちらの条件を満たす必要があります。

tony

2018/04/20 10:38

CentOS-Base.repoに書き加えるという認識でよろしいでしょうか? 試してみまして、結果がやや変わりましたがupdateできないのは変わらないです。。 ``` 読み込んだプラグイン:fastestmirror base | 3.6 kB 00:00:00 extras | 3.4 kB 00:00:00 extras/7/x86_64/primary_db FAILED http://ftp.riken.jp/Linux/centos/7/extras/x86_64/repodata/bb92e998e4b05352722607eef35d52c364ed95f4095f9e5807373bd6da7c02aa-primary.sqlite.bz2: [Errno 12] Timeout on http://ftp.riken.jp/Linux/centos/7/extras/x86_64/repodata/bb92e998e4b05352722607eef35d52c364ed95f4095f9e5807373bd6da7c02aa-primary.sqlite.bz2: (28, 'Operation too slow. Less than 1000 bytes/sec transferred the last 30 seconds') 他のミラーを試します。 base/7/x86_64/group_gz FAILED http://ftp.riken.jp/Linux/centos/7/os/x86_64/repodata/9346184be1deb727caf4b1ecf4a7949155da5da74af9b92c172687b290a773df-c7-x86_64-comps.xml.gz: [Errno 12] Timeout on http://ftp.riken.jp/Linux/centos/7/os/x86_64/repodata/9346184be1deb727caf4b1ecf4a7949155da5da74af9b92c172687b290a773df-c7-x86_64-comps.xml.gz: (28, 'Operation too slow. Less than 1000 bytes/sec transferred the last 30 seconds') 他のミラーを試します。 base/7/x86_64/primary_db FAILED http://ftp.riken.jp/Linux/centos/7/os/x86_64/repodata/0c34273ad0292747ee5e15c047d3e51c67ca59861a446972db45d71abacc7ad7-primary.sqlite.bz2: [Errno 12] Timeout on http://ftp.riken.jp/Linux/centos/7/os/x86_64/repodata/0c34273ad0292747ee5e15c047d3e51c67ca59861a446972db45d71abacc7ad7-primary.sqlite.bz2: (28, 'Operation too slow. Less than 1000 bytes/sec transferred the last 30 seconds') 他のミラーを試します。 ・ ・ ・ ```
guest

0

昔yumの更新で苦労したので、この手のトラブルは慣れていますが。

ネット周り、VBoxのネットワーク設定は問題ないように見受けられます。

解決策 (というか確認)

yum が [Errno 256] No more mirrors to try エラーを返す

こちらの手順で、キャッシュを削除し、yum clean all試してみてください。それでもだめだとすると

ping (コンフィグファイルに書いた、updatesサイトのrepo URL)

で結果が返ってくるか、確認してください。


最悪、yumの削除、再インストールで解決するかもしれません。
これは慎重に判断してください。

この強制的解決だと、副作用が発生するかもしれません。
(サーバにあるyumのリポジトリの履歴、更新や
各パッケージの新規インストール・更新の履歴が
壊れ/削除され、新しいyumの動作に支障をきたす。

前に経験しました)

投稿2018/04/20 06:37

kawakawa2018

総合スコア1195

バッドをするには、ログインかつ

こちらの条件を満たす必要があります。

tony

2018/04/20 10:33

ご指定のURLを見てみたところ こちらの環境(Centos)とはやや構成が異なるようで、どうしたらいいのかいまいちつかめませんでした。 ちなみにリポジトリの構成は下記です。 $ls /etc/yum.repos.d CentOS-Base.repo CentOS-CR.repo CentOS-Debuginfo.repo CentOS-Sources.repo CentOS-Vault.repo CentOS-fasttrack.repo ためしに上記ディレクトリを一時的に空にしてyum updateを試したところリポジトリが存在しないとのエラーメッセージが出ました。
kawakawa2018

2018/04/20 11:38

すみません、少し整理して説明が欲しいです。 ・「fastestmirror」yum-fastestmirrorプラグインを使っていますね? ・デフォルトで「yum-fastestmirror」をリポジトリのアクセスと設定してると仮定して、 fastestmirror.confの内容を確認するのが、先決ですよ。 参考 https://centos.bungu-do.jp/archives/27 https://qiita.com/toshiro3/items/11a97ac67d65cf94ae91 ・それから「/etc/yum.conf」 ここに「fastestmirror」があるので、それが正しいか確認。 ・あと エラーが出たときの「yum install xxx」、xxxは何のパッケージでしょう。
guest

あなたの回答

tips

太字

斜体

打ち消し線

見出し

引用テキストの挿入

コードの挿入

リンクの挿入

リストの挿入

番号リストの挿入

表の挿入

水平線の挿入

プレビュー

15分調べてもわからないことは
teratailで質問しよう!

ただいまの回答率
85.48%

質問をまとめることで
思考を整理して素早く解決

テンプレート機能で
簡単に質問をまとめる

質問する

関連した質問