yum で error: [Errno 256] No more mirrors to try が返される理由
Environment
- Red Hat Enterprise Linux
- Red Hat カスタマーポータル
- Red Hat Subscription Management (RHSM)
- Red Hat Satellite
Issue
yum updateが error : [Errno 256] No more mirrors to try で失敗します。
Resolution
-
ネットワーク接続を確認してください。IP ベースのファイアウォールを使用している場合は、Public CIDR Lists for Red Hat (IP Addresses for cdn.redhat.com) に記載されている IP アドレスをホワイトリストに追加して、コンテンツ配信ネットワーク (CDN) へのアクセスを許可します。
-
/etc/yum.repos.dディレクトリーにどのようなファイルが存在するかを確認するには、以下の手順に従ってください。# ll /etc/yum.repos.d -
システムが subscription-manager を介して Red Hat Subscription Manager (RHSM) に登録されている場合、
rhel-source.repoとredhat.repoが存在します。 -
ローカルリポジトリーまたはその他のメディアリポジトリーが存在する場合は、以下の手順で削除してください。
# rm -rf /etc/yum.repos.d/<local or other repository name> -
以下のコマンドを実行して、システムから古い yum キャッシュを削除します。
# rm -fr /var/cache/yum/* # yum clean all -
有効なリポジトリーがリストされているかどうかを確認するには、以下を実行してください。
# yum repolist -
前述の解決策がうまくいかない場合は、以下の手順で各リポジトリーを 1 つずつ再有効化してみてください。
# REPOLIST=`subscription-manager repos --list-enabled | grep "Repo ID" | awk '{print $3}'` # subscription-manager repos --disable="*" # rm -fr /var/cache/yum/* # yum clean all # for i in ${REPOLIST}; do subscription-manager repos --enable=$i ; yum repolist; done
Root Cause
- この問題が発生する可能性のある理由:
- yum キャッシュが破損している。
- ネットワーク関連の問題により、システムからリポジトリーの URL にアクセスできない。
- カスタマイズされたメディアリポジトリーまたはその他のメディアリポジトリーが存在する。
- Red Hat のコンテンツ配信ネットワーク (CDN) にアクセスするために IP ベースのファイアウォール設定を使用する時にホワイトリストが古くなっている。
Diagnostic Steps
-
yum updateが以下のいずれかのエラーで失敗します。Error Downloading Packages: InstallMedia: [Errno 256] No more mirrors to try.Error Downloading Packages: ftp-0.17-35.el5.x86_64:failure:ftp-0.17-35.el5.x86_64.rpm from Red5repo55:[Errno 256] No more mirrors to try. [[6]]" (code -1) Packages ScheduledDownloading Packages: https://cdn.redhat.com/content/dist/rhel/server/6/6Server/x86_64/supplementary/os/Packages/java-1.6.0-ibm-1.6.0.15.0-1jpp.1.el6_4.x86_64.rpm: [Errno 14] PYCURL ERROR 22 - "The requested URL returned an error: 404 Not Found" Trying other mirrors. Error Downloading Packages: 1:java-1.6.0-ibm-1.6.0.15.0-1jpp.1.el6_4.x86_64: failure: Packages/java-1.6.0-ibm-1.6.0.15.0-1jpp.1.el6_4.x86_64.rpm from rhel-6-server-supplementary- rpms: [Errno 256] No more mirrors to try. -
Satellite Serverでは /var/log/messages に示されているように、このエラーで失敗します。Jul 24 12:12:53 sat.example.com pulp: requests.packages.urllib3.connectionpool:INFO: Starting new HTTPS connection (1): cdn.redhat.com Jul 24 12:12:53 sat.example.com pulp: nectar.downloaders.threaded:INFO: Download failed: -
システム/ネットワーク上でリポジトリー URL へのアクセス可能性を確認してください。
# ping URL -
/etc/yum.repos.dディレクトリー内のリポジトリーを確認してください。# ll /etc/yum.repos.d
This solution is part of Red Hat’s fast-track publication program, providing a huge library of solutions that Red Hat engineers have created while supporting our customers. To give you the knowledge you need the instant it becomes available, these articles may be presented in a raw and unedited form.
Comments