vagrant-libvirt: Can't install vagrant-libvirt on Fedora

Error message showing that I don’t have libvirt on my distribution while I already installed: vagrant plugin install vagrant-libvirt

  • Error message:
Installing the 'vagrant-libvirt' plugin. This can take a few minutes...
Building native extensions. This could take a while...
Vagrant failed to install the requested plugin because it depends
on a library which is not currently installed on this system. The
following library is required by the 'vagrant-libvirt' plugin:

  libvirt

Please install the library and then run the command again.

Steps to reproduce the error:

Error message:

Installing the 'vagrant-libvirt' plugin. This can take a few minutes...
Building native extensions. This could take a while...
Vagrant failed to install the requested plugin because it depends
on a library which is not currently installed on this system. The
following library is required by the 'vagrant-libvirt' plugin:

  libvirt

Please install the library and then run the command again.

Does anyone know if I miss something?

About this issue

  • Original URL
  • State: closed
  • Created 3 years ago
  • Comments: 15 (8 by maintainers)

Most upvoted comments

Minor correction to the above instructions, you probably want to run the following to ensure an explicit install of the vagrant-libvirt dependencies so that fedora doesn’t think it can automatically remove them subsequently.

dependencies=$(sudo dnf repoquery --qf "%{name}" $(for dep in $(sudo dnf repoquery --depends vagrant-libvirt 2>/dev/null | cut -d' ' -f1); do echo "--whatprovides ${dep} "; done) 2>/dev/null)
sudo dnf mark install ${dependencies}

Or change the instruction sudo dnf install @virtualization vagrant-libvirt to:

dependencies=$(sudo dnf repoquery --qf "%{name}" $(for dep in $(sudo dnf repoquery --depends vagrant-libvirt 2>/dev/null | cut -d' ' -f1); do echo "--whatprovides ${dep} "; done) 2>/dev/null)
sudo dnf install @virtualization ${dependencies}

I hadn’t considered that it would keep using the upstream package, thanks for sharing that, I’ll have to keep that in mind for any instructions I share.

Hopefullly something as simple as the following would work to switch to the distro packaged verison:

dnf config-manager --set-disabled hashicorp

I got it. I keep uninstalling and installing vagrant with distro again but it always picks up the one from hashicorp because I have the repo enabled. I disable harshicorp repo and follow your step above. It works perfectly. Thanks a lot @electrofelix