Skip to content
This repository has been archived by the owner on Dec 5, 2022. It is now read-only.

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

LalatenduMohanty opened this issue Nov 15, 2015 · 5 comments


Copy link

While trying to use Fedora Vagrant boxes ( with libvirt provider

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

I got below error because :

  • The config file of DNF has changed from /etc/yum.conf to /etc/dnf/dnf.conf
  • The cache directory is now at /var/cache/dnf
  • The option to enable caching for DNF is sudo bash -c "echo 'keepcache=true' >> /etc/dnf/dnf.conf"
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 :

LalatenduMohanty added a commit to LalatenduMohanty/vagrant-cachier that referenced this issue Nov 15, 2015
Dnf is the new package manager for Fedora.
And it is the default package manager for F22 and F23

Signed-off-by: Lalatendu Mohanty <>
Copy link

jzohrab commented Mar 18, 2016

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.

artem-sidorenko added a commit to artem-sidorenko/vagrant-environments that referenced this issue May 27, 2016
Copy link

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

  if Vagrant.has_plugin?("vagrant-cachier")
    config.cache.scope = :box
    config.cache.auto_detect = false

Copy link

rmohr commented Sep 26, 2016

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.

Copy link

rmohr commented Nov 22, 2016

Fixed in #180

@rmohr rmohr closed this as completed Nov 22, 2016
Copy link

jdeathe commented Sep 16, 2022

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

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
None yet
None yet

No branches or pull requests

5 participants