New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

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

Closed
LalatenduMohanty opened this Issue Nov 15, 2015 · 4 comments

Comments

Projects
None yet
4 participants
@LalatenduMohanty

LalatenduMohanty commented Nov 15, 2015

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 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 : https://fedoraproject.org/wiki/Changes/ReplaceYumWithDNF

LalatenduMohanty added a commit to LalatenduMohanty/vagrant-cachier that referenced this issue Nov 15, 2015

Fixes Issue #163: Modification for DNF package manager
Dnf is the new package manager for Fedora.
And it is the default package manager for F22 and F23

Signed-off-by: Lalatendu Mohanty <lmohanty@redhat.com>
@jzohrab

This comment has been minimized.

Show comment
Hide comment
@jzohrab

jzohrab 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.

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

@olberger

This comment has been minimized.

Show comment
Hide comment
@olberger

olberger Jun 15, 2016

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

olberger commented Jun 15, 2016

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

This comment has been minimized.

Show comment
Hide comment
@rmohr

rmohr Sep 26, 2016

Collaborator

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.

Collaborator

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.

@rmohr

This comment has been minimized.

Show comment
Hide comment
@rmohr

rmohr Nov 22, 2016

Collaborator

Fixed in #180

Collaborator

rmohr commented Nov 22, 2016

Fixed in #180

@rmohr rmohr closed this Nov 22, 2016

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment