centos7 yum fastmirror が使用できない場合はどうすればよいですか?

藏色散人
リリース: 2020-05-06 15:18:40
転載
10148 人が閲覧しました

次のコラム centos 基本チュートリアル では、centos7 yum fastmirror が使えない問題の解決方法を紹介しますので、困っている方のお役に立てれば幸いです。

centos7 yum fastmirror が使用できない場合はどうすればよいですか?

centos7 yum fastmirror は使用できません

[root@localhost ~]# yum install lrzsz
Loaded plugins: fastestmirror
Could not retrieve mirrorlist http://mirrorlist.centos.org/?release=7&arch=x86_64&repo=os&infra=stock error was
14: curl#6 - "Could not resolve host: mirrorlist.centos.org; Unknown error"
ログイン後にコピー

====================== == ===========================

ステップ 1:

[root@localhost ~]# vi  /etc/yum/pluginconf.d/fastestmirror.conf 
[main]
enabled=1//把1改为0  
verbose=0
always_print_best_host = true
socket_timeout=3
#  Relative paths are relative to the cachedir (and so works for users as well
# as root).
hostfilepath=timedhosts.txt
maxhostfileage=10
maxthreads=15
#exclude=.gov, facebook
#include_only=.nl,.de,.uk,.ie
ログイン後にコピー

===== = ======================================

ステップ 2:

[root@localhost ~]# vi /etc/yum.conf
[main]
cachedir=/var/cache/yum/$basearch/$releasever
keepcache=0
debuglevel=2
logfile=/var/log/yum.log
exactarch=1
obsoletes=1
gpgcheck=1
plugins=1//将plugins的值修改为0
installonly_limit=5
bugtracker_url=http://bugs.centos.org/set_project.php?project_id=23&ref=http://bugs.centos.org/bug_report_page.php?category=yum
distroverpkg=centos-release
#  This is the default, if you make this bigger yum won't see if the metadata
# is newer on the remote and so you'll "gain" the bandwidth of not having to
# download the new metadata and "pay" for it by yum not having correct
# information.
#  It is esp. important, to have correct metadata, for distributions like
# Fedora which don't keep old packages around. If you don't like this checking
# interupting your command line usage, it's much better to have something
# manually check the metadata once an hour (yum-updatesd will do this).
# metadata_expire=90m
# PUT YOUR REPOS HERE OR IN separate files named file.repo
# in /etc/yum.repos.d
ログイン後にコピー

============================================ ===

実行を続行すると、次のエラーが発生します

[root@localhost ~]# yum install lrzsz
Could not retrieve mirrorlist http://mirrorlist.centos.org/?release=7&arch=x86_64&repo=os&infra=stock error was
14: curl#6 - "Could not resolve host: mirrorlist.centos.org; Unknown error"
 One of the configured repositories failed (Unknown),
 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. リポジトリの上流に連絡し、問題の修正を依頼します。

2.リポジトリのbaseurl/などを再構成して、動作中の

アップストリームを指すようにします。これは、リポジトリでサポートされているものよりも新しい

ディストリビューション リリースを使用している場合に最も役立ちます(およびthe

以前の配布リリースのパッケージは引き続き動作します).

3. リポジトリを一時的に無効にしてコマンドを実行します

yum --disablerepo= .. .

4. リポジトリを永続的に無効にするため、yum はデフォルトでリポジトリを使用しません。その後、Yum

は、再度永続的に有効にするまで、リポジトリを無視します。一時的な使用には --enablerepo を使用します:

yum-config-manager --disable

または

subscription-manager repos --disable=

5. 障害が発生したリポジトリが利用できない場合は、そのリポジトリがスキップされるように設定します。

yum は、ほとんどのコマンドを実行するときにリポジトリへの接続を試みることに注意してください。そのため、毎回試行して失敗する必要があります (したがって、yum ははるかに

遅くなります)。ただし、非常に一時的な問題であれば、これは多くの場合、良い

妥協案です:

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

リポジトリの有効なベース URL が見つかりません:base/7/x86_64

#= =============================================

理由: resolv.conf が構成されていません

解決策:

/etc ディレクトリで resolv.conf を構成し、次のようなネームサーバー IP を追加します。

[root@localhost ~]# vi /etc/resolv.conf
nameserver 8.8.8.8
nameserver 8.8.4.4
search localdomain
ログイン後にコピー

再度保存する コマンドを実行するだけです。

その他の centos 技術記事については、

centos チュートリアル

列をご覧ください。

以上がcentos7 yum fastmirror が使用できない場合はどうすればよいですか?の詳細内容です。詳細については、PHP 中国語 Web サイトの他の関連記事を参照してください。

関連ラベル:
ソース:csdn.net
このウェブサイトの声明
この記事の内容はネチズンが自主的に寄稿したものであり、著作権は原著者に帰属します。このサイトは、それに相当する法的責任を負いません。盗作または侵害の疑いのあるコンテンツを見つけた場合は、admin@php.cn までご連絡ください。
人気のチュートリアル
詳細>
最新のダウンロード
詳細>
ウェブエフェクト
公式サイト
サイト素材
フロントエンドテンプレート
私たちについて 免責事項 Sitemap
PHP中国語ウェブサイト:福祉オンライン PHP トレーニング,PHP 学習者の迅速な成長を支援します!