vagrant upが「One of the configured repositories failed」エラーで失敗するときの対処方法


Vagrantで管理するCentOS7を $ vagrant up で起動しようとしたときに以下のようなエラーが出た場合の対処方法です。

Bringing machine 'default' up with 'virtualbox' provider...
==> default: Clearing any previously set forwarded ports...
==> default: Clearing any previously set network interfaces...
==> default: Preparing network interfaces based on configuration...
    default: Adapter 1: nat
    default: Adapter 2: hostonly
==> default: Forwarding ports...
    default: 22 (guest) => 2222 (host) (adapter 1)
    default: 29324 (guest) => 29324 (host) (adapter 1)
==> default: Running 'pre-boot' VM customizations...
==> default: Booting VM...
==> default: Waiting for machine to boot. This may take a few minutes...
    default: SSH address:
    default: SSH username: vagrant
    default: SSH auth method: private key
==> default: Machine booted and ready!
[default] GuestAdditions versions on your host (6.1.26) and guest (6.0.10) do not match.

 One of the configured repositories failed (不明),
 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

            yum-config-manager --save --setopt=<repoid>.skip_if_unavailable=true

Cannot retrieve metalink for repository: epel/x86_64. Please verify its path and try again
Unmounting Virtualbox Guest Additions ISO from: /mnt
umount: /mnt: not mounted
==> default: Checking for guest additions in VM...
    default: The guest additions on this VM do not match the installed version of
    default: VirtualBox! In most cases this is fine, but in rare cases it can
    default: prevent things such as shared folders from working properly. If you see
    default: shared folder errors, please make sure the guest additions within the
    default: virtual machine match the version of VirtualBox you have installed on
    default: your host and reload your VM.
    default: Guest Additions Version: 6.0.10
    default: VirtualBox Version: 6.1
The following SSH command responded with a non-zero exit status.
Vagrant assumes that this means the command failed!

umount /mnt

Stdout from the command:

Stderr from the command:

umount: /mnt: not mounted


  • ホストマシン
    • macOS Big Sur 11.5.2
    • VirtualBox 6.1.26 r145957 (Qt5.6.3)
    • Vagrant 2.2.18
  • ゲストマシン
    • CentOS Linux release 7.1.1503 (Core)


  • 仮想マシンにSSH接続する

    vagrant ssh

    vagrant up でエラーが出ていても、仮想マシン自体は起動しているのでSSHはできる。

  • yumのミラーレポジトリを無効化する

    • /etc/yum.repos.d/epel.repo を以下のように編集する

      name=Extra Packages for Enterprise Linux 7 - $basearch
      - #baseurl=$basearch
      + baseurl=$basearch
      - mirrorlist=$basearch
      + #mirrorlist=$basearch
      name=Extra Packages for Enterprise Linux 7 - $basearch - Debug
      - #baseurl=$basearch/debug
      + baseurl=$basearch/debug
      - #mirrorlist=$basearch
      + mirrorlist=$basearch
      name=Extra Packages for Enterprise Linux 7 - $basearch - Source
      - #baseurl=
      + baseurl=
      - #mirrorlist=$basearch
      + mirrorlist=$basearch
  • 仮想マシンを再起動する

    vagrant reload






© 2021 / This site uses Google Analytics.