fgrehm / vagrant-cachier

Caffeine reducer
http://fgrehm.viewdocs.io/vagrant-cachier
MIT License
1.08k stars 111 forks source link

vagrant-cachier not working with DNF package manager of Fedora #163

Closed LalatenduMohanty closed 7 years ago

LalatenduMohanty commented 8 years ago

While trying to use Fedora Vagrant boxes (https://atlas.hashicorp.com/fedora/) with libvirt provider

$ vagrant init fedora/23-cloud-base
$ vagrant up

I got below error because :

The following SSH command responded with a non-zero exit status.
Vagrant assumes that this means the command failed!

sed -i 's/keepcache=0/keepcache=1/g' /etc/yum.conf

Stdout from the command:

Stderr from the command:

sed: can't read /etc/yum.conf: No such file or directory

DNF is the default package manager for currently supported (from Fedora Project) Fedora releases i.e. Fedora 22 and 23 (21 's support is ending on Dec 4th 2015). However DNF is introduced from Fedora 18. refer : https://fedoraproject.org/wiki/Changes/ReplaceYumWithDNF

jzohrab commented 8 years ago

I hit this issue as well. I got around it with

$ vagrant ssh
$ sudo ln -s /etc/dnf/dnf.conf /etc/yum.conf 
$ exit
$ vagrant reload

Not the best, but appears to suffice.

olberger commented 8 years ago

As a workaround, I've tried the following that might be working (not fully sure, since I'm a newbee wrt dnf), in the Vagrantfile:

config.vm.provision "shell", inline: <<-SHELL
    sudo echo "keepcache=True" >> /etc/dnf/dnf.conf
    sudo rm -fr /var/cache/dnf
    sudo ln -s /tmp/vagrant-cache/dnf /var/cache/dnf
  SHELL

  if Vagrant.has_plugin?("vagrant-cachier")
    config.cache.scope = :box
    config.cache.auto_detect = false
  end
rmohr commented 7 years ago

Missed this patch here. I wrote my own DNF plugin in #180. It also fixes the DNF/Yum problem by checking if DNF or Yum is installed on the machine.

rmohr commented 7 years ago

Fixed in #180

jdeathe commented 1 year ago

@rmohr Will the DNF plugin be included in a release tag?