Vagrant plugins and Fedora Magazine's article https://fedoramagazine.org/vagrant-qemukvm-fedora-devops-sysadmin/

Mr. Mott’s article on Fedora Magazine tells us to prepend sudo to install Vagrant plugins like in sudo vagrant plugin install vagrant-libvirt, why is that? What would be wrong with running vagrant plugin install vagrant-libvirt as a regular user?

In any case, running vagrant plugin uninstall x failed both with and without sudo for vagrant-cachier and vagrant-libvirt. For example:

>  [I] ➜ vagrant plugin uninstall vagrant-cachier                                                                                                                
> Uninstalling the 'vagrant-cachier' plugin...                                                                                                                   
> Traceback (most recent call last):                                                                                                                             
>         23: from /usr/share/vagrant/gems/bin/vagrant:23:in `<main>'                                                                                            
>         22: from /usr/share/vagrant/gems/bin/vagrant:23:in `load'                                                                                              
>         21: from /usr/share/vagrant/gems/gems/vagrant-2.2.9/bin/vagrant:205:in `<top (required)>'                                                              
>         20: from /usr/share/vagrant/gems/gems/vagrant-2.2.9/lib/vagrant/environment.rb:290:in `cli'                                                            
>         19: from /usr/share/vagrant/gems/gems/vagrant-2.2.9/lib/vagrant/cli.rb:67:in `execute'                                                                 
>         18: from /usr/share/vagrant/gems/gems/vagrant-2.2.9/plugins/commands/plugin/command/root.rb:66:in `execute'                                            
>         17: from /usr/share/vagrant/gems/gems/vagrant-2.2.9/plugins/commands/plugin/command/uninstall.rb:25:in `execute'                                       
>         16: from /usr/share/vagrant/gems/gems/vagrant-2.2.9/plugins/commands/plugin/command/uninstall.rb:25:in `each'                                          
>         15: from /usr/share/vagrant/gems/gems/vagrant-2.2.9/plugins/commands/plugin/command/uninstall.rb:26:in `block in execute'                              
>         14: from /usr/share/vagrant/gems/gems/vagrant-2.2.9/plugins/commands/plugin/command/base.rb:14:in `action'                                             
>         13: from /usr/share/vagrant/gems/gems/vagrant-2.2.9/lib/vagrant/action/runner.rb:89:in `run'                                                           
>         12: from /usr/share/vagrant/gems/gems/vagrant-2.2.9/lib/vagrant/util/busy.rb:19:in `busy'                                                              
>         11: from /usr/share/vagrant/gems/gems/vagrant-2.2.9/lib/vagrant/action/runner.rb:89:in `block in run'                                                  
>         10: from /usr/share/vagrant/gems/gems/vagrant-2.2.9/lib/vagrant/action/builder.rb:116:in `call'                                                        
>          9: from /usr/share/vagrant/gems/gems/vagrant-2.2.9/lib/vagrant/action/warden.rb:48:in `call'                                                          
>          8: from /usr/share/vagrant/gems/gems/vagrant-2.2.9/plugins/commands/plugin/action/plugin_exists_check.rb:20:in `call'                                 
>          7: from /usr/share/vagrant/gems/gems/vagrant-2.2.9/lib/vagrant/action/warden.rb:48:in `call'                                                          
>          6: from /usr/share/vagrant/gems/gems/vagrant-2.2.9/plugins/commands/plugin/action/uninstall_plugin.rb:18:in `call'                                             5: from /usr/share/vagrant/gems/gems/vagrant-2.2.9/lib/vagrant/plugin/manager.rb:211:in `uninstall_plugin'                                            
>          4: from /usr/share/vagrant/gems/gems/vagrant-2.2.9/lib/vagrant/bundler.rb:435:in `clean'                                                              
>          3: from /usr/share/vagrant/gems/gems/vagrant-2.2.9/lib/vagrant/bundler.rb:435:in `each'                                                               
>          2: from /usr/share/vagrant/gems/gems/vagrant-2.2.9/lib/vagrant/bundler.rb:444:in `block in clean'                                                     
>          1: from /usr/share/rubygems/rubygems/uninstaller.rb:161:in `uninstall_gem'                                                                            
> /usr/share/rubygems/rubygems/uninstaller.rb:263:in `remove': uninitialized constant Gem::RDoc (NameError)

I am also sharing my notes on using Vagrant & friends.

Hello @ebirman …! Welcome to the community! Please do take a few minutes to go over the introductory posts in #start-here when you have the time. They contain lots of useful information.

I can’t reproduce your issue, but I’ve got something to say here:

Most of this varant plug-ins are Ruby Gems:

  1. How do you install it? using dnf command is enough…
sudo dnf install vagrant-cachier
  1. List of plug-ins:
vagrant plugin list

vagrant-cachier (1.2.1, system)
vagrant-libvirt (0.1.2, system)
  1. Uninstall:
sudo vagrant plugin uninstall vagrant-cachier

Uninstalling the 'vagrant-cachier' plugin...
The plugin you're attempting to uninstall ('vagrant-cachier') is a
system plugin. This means that the plugin is part of the installation
of Vagrant. These plugins cannot be removed.

You can however, install a plugin with the same name to replace
these plugins. User-installed plugins take priority over
system-installed plugins.

so to uninstall, just type:

sudo dnf remove vagrant-cachier
  1. If you tried to install vagrant-cachier with the following command, you’ve got a Ruby dependency error:
sudo vagrant plugin install vagrant-cachier

Installing the 'vagrant-cachier' plugin. This can take a few minutes...
Vagrant failed to properly resolve required dependencies. These
errors can commonly be caused by misconfigured plugin installations
or transient network issues. The reported error is:

conflicting dependencies racc (= 1.4.16) and racc (= 1.5.1)
  Activated racc-1.5.1
  which does not match conflicting dependency (= 1.4.16)

  Conflicting dependency chains:
    racc (= 1.5.1), 1.5.1 activated

  versus:
    racc (= 1.4.16)

  Gems matching racc (= 1.4.16):
    racc-1.4.16

so, The same Question again, How did you install it?

to get/obtain the full List of all plug-ins which you can install via dnf, just:

dnf search vagrant

Regards.,

2 Likes

Thank you, I am already using the packages provided by Fedora and I think the mantainer is doing a great job. But that was not my question.

Re. the error message, perhaps it has to do with my local ruby distribution managed by asdf interfering with the vagrant packaged installed with dnf (?) Not sure.

Regards

1.- The answer of your question, There is a bug in vagrant:

Investigation the problem you encontred, there is a bug in redhat bugzilla and explain the problem very well:

https://bugzilla.redhat.com/show_bug.cgi?id=1835308

I found it, following the comment of the magazine post…

2.- About your ERROR, is it about Rdoc:

Just Remove it, as said in this Can't install vagrant-disksize on fedora 30 with Vagrant 2.2.4 and rubygem-rdoc-6.1.0 · Issue #32 · sprotheroe/vagrant-disksize · GitHub

As a temporary workaround, just do dnf remove rubygem-rdoc to get it working.

3.- Aditional to this is a good habit and prefer method to install gem from a rpm than install from gem.

rpm -qa rubygem-rdoc                       
rubygem-rdoc-6.2.1-201.fc33.noarch
gem list | grep rdoc
rdoc (6.2.1)

Both version matched…

Regards.,

3 Likes

This topic was automatically closed 28 days after the last reply. New replies are no longer allowed.