CDROMリポジトリはキャッシュを作成できません。

CDROMリポジトリはキャッシュを作成できません。

私のCentOS 7.2:

/dev/sr0マイコンピュータに仮想CDROM()をインストールしました/mnt/cdrom

mountコマンドを使用してインストールリストを確認しましたが、ここには次の情報が含まれています。

...
/dev/sr0 on /mnt/cdrom type iso9660 (ro,relatime)
...

しかし、ls /mnt/cdrom内部にrepoデータがある場合:

[root@localhost cdrom]# ls
CentOS_BuildTag  GPL       LiveOS    RPM-GPG-KEY-CentOS-7
EFI              images    Packages  RPM-GPG-KEY-CentOS-Testing-7
EULA             isolinux  repodata  TRANS.TBL

ローカルリポジトリを作成しました。

vi /etc/yum.repos.d/redhat_cdrom.repo

ここに次の設定を追加します。

[redhat_cdrom]
name=red hat cdrom yum source
baseurl=file:///mnt/cdrom/
gpgcheck=0
enable=1

しかし、yumリポジトリをキャッシュすると、次のようになります。

[root@localhost cdrom]# yum clean all
[root@localhost cdrom]# yum makecache


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"


 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. 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. Disable the repository, 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 <repoid>

     4. 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=<repoid>.skip_if_unavailable=true

Cannot find a valid baseurl for repo: base/7/x86_64

ベストアンサー1

DVDで作成されたこのストレージのみを使用するには、他のすべてのストレージを無効にし、提供されたストレージのみを使用できます。

# yum --disablerepo="*" --enablerepo="redhat_cdrom" makecache

ただし、利用可能なすべてのオンラインストアのキャッシュを生成するには、アクティブなインターネット接続が必要です。エラーフラグメントを見ると、ノードがインターネットに接続されていないか、プロキシの背後にあるCentOSストレージサーバーにアクセスできないように見えます。

インストールが成功した後にパッケージキャッシュを保存するには、次のテキスト[main]/etc/yum.conf

keepcache = 1

キャッシュが有効になると、各Yumジョブは設定されたリポジトリからパッケージデータをダウンロードできます。

現在アクティブなYumリポジトリのすべてのメタデータをダウンロードして使用可能にするには、次のように入力します。

# yum makecache

ネットワーク接続なしでyumコマンドを実行するには、以下を追加します。-氏コマンドラインオプション。このオプションを有効にすると、yumはネットワークストレージを確認せずに実行を続け、キャッシュされたファイルのみを使用します。このモードでは、yumは以前の操作でダウンロードされ、キャッシュされたパッケージのみをインストールできます。

# yum -C list glibc

から」インターネットに接続せずにキャッシュとしてyumをローカルに使用する方法は?

おすすめ記事