title: "yum -y install nfs-utils nfs-utils-lib" when installing NFS client on a CentOS vagrant machine
body: <p>I was trying to "vagrant up" a CentOS machine (<code>centos7-x64-vbox43</code>) with VirtualBox as provider and ansible as the provisioning tool. I executed the following command:</p>
  
  <pre><code>vagrant up --provision-with ansible
  </code></pre>
  
  <p>but I got an error, which is related to the execution of the following command <code>yum -y install nfs-utils nfs-utils-lib</code> in the guest machine (I guess):</p>
  
  <pre><code>[project-name] &gt; vagrant up
  /opt/vagrant/embedded/gems/gems/vagrant-1.8.1/lib/vagrant/pre-rubygems.rb:31: warning: Insecure world writable dir /Applications/Qt in PATH, mode 040777
  /opt/vagrant/embedded/gems/gems/bundler-1.10.6/lib/bundler/shared_helpers.rb:78: warning: Insecure world writable dir /Applications/Qt in PATH, mode 040777
  Bringing machine 'default' up with 'virtualbox' provider...
  ==&gt; default: Clearing any previously set forwarded ports...
  ==&gt; default: Clearing any previously set network interfaces...
  ==&gt; default: Preparing network interfaces based on configuration...
      default: Adapter 1: nat
      default: Adapter 2: hostonly
  ==&gt; default: Forwarding ports...
      default: 80 (guest) =&gt; 2000 (host) (adapter 1)
      default: 22 (guest) =&gt; 2222 (host) (adapter 1)
  ==&gt; default: Running 'pre-boot' VM customizations...
  ==&gt; default: Booting VM...
  ==&gt; default: Waiting for machine to boot. This may take a few minutes...
      default: SSH address: 127.0.0.1:2222
      default: SSH username: vagrant
      default: SSH auth method: private key
      default: Warning: Remote connection disconnect. Retrying...
  ==&gt; default: Machine booted and ready!
  ==&gt; default: Checking for guest additions in VM...
      default: The guest additions on this VM do not match the installed version of
      default: VirtualBox! In most cases this is fine, but in rare cases it can
      default: prevent things such as shared folders from working properly. If you see
      default: shared folder errors, please make sure the guest additions within the
      default: virtual machine match the version of VirtualBox you have installed on
      default: your host and reload your VM.
      default: 
      default: Guest Additions Version: 4.3.14
      default: VirtualBox Version: 5.0
  ==&gt; default: Setting hostname...
  ==&gt; default: Configuring and enabling network interfaces...
  ==&gt; default: Installing NFS client...
  The following SSH command responded with a non-zero exit status.
  Vagrant assumes that this means the command failed!
  
  yum -y install nfs-utils nfs-utils-lib
  
  Stdout from the command:
  
  Loaded plugins: fastestmirror
  Loading mirror speeds from cached hostfile
   * base: mirror.switch.ch
   * extras: mirror.ratiokontakt.de
   * updates: mirror.ratiokontakt.de
  No package nfs-utils-lib available.
  Resolving Dependencies
  --&gt; Running transaction check
  ---&gt; Package nfs-utils.x86_64 1:1.3.0-0.21.el7_2.1 will be installed
  --&gt; Processing Dependency: libtirpc &gt;= 0.2.3-1 for package: 1:nfs-utils-1.3.0-0.21.el7_2.1.x86_64
  --&gt; Processing Dependency: gssproxy &gt;= 0.3.0-0 for package: 1:nfs-utils-1.3.0-0.21.el7_2.1.x86_64
  --&gt; Processing Dependency: rpcbind for package: 1:nfs-utils-1.3.0-0.21.el7_2.1.x86_64
  --&gt; Processing Dependency: quota for package: 1:nfs-utils-1.3.0-0.21.el7_2.1.x86_64
  --&gt; Processing Dependency: libnfsidmap for package: 1:nfs-utils-1.3.0-0.21.el7_2.1.x86_64
  --&gt; Processing Dependency: libevent for package: 1:nfs-utils-1.3.0-0.21.el7_2.1.x86_64
  --&gt; Processing Dependency: libdevmapper.so.1.02(DM_1_02_97)(64bit) for package: 1:nfs-utils-1.3.0-0.21.el7_2.1.x86_64
  --&gt; Processing Dependency: keyutils for package: 1:nfs-utils-1.3.0-0.21.el7_2.1.x86_64
  --&gt; Processing Dependency: libtirpc.so.1()(64bit) for package: 1:nfs-utils-1.3.0-0.21.el7_2.1.x86_64
  --&gt; Processing Dependency: libnfsidmap.so.0()(64bit) for package: 1:nfs-utils-1.3.0-0.21.el7_2.1.x86_64
  --&gt; Processing Dependency: libevent-2.0.so.5()(64bit) for package: 1:nfs-utils-1.3.0-0.21.el7_2.1.x86_64
  --&gt; Running transaction check
  ---&gt; Package device-mapper-libs.x86_64 7:1.02.84-14.el7 will be updated
  --&gt; Processing Dependency: device-mapper-libs = 7:1.02.84-14.el7 for package: 7:device-mapper-1.02.84-14.el7.x86_64
  ---&gt; Package device-mapper-libs.x86_64 7:1.02.107-5.el7_2.5 will be an update
  ---&gt; Package gssproxy.x86_64 0:0.4.1-7.el7 will be installed
  --&gt; Processing Dependency: krb5-libs &gt;= 1.12.0 for package: gssproxy-0.4.1-7.el7.x86_64
  --&gt; Processing Dependency: libverto-tevent for package: gssproxy-0.4.1-7.el7.x86_64
  --&gt; Processing Dependency: libini_config.so.3(INI_CONFIG_1.1.0)(64bit) for package: gssproxy-0.4.1-7.el7.x86_64
  --&gt; Processing Dependency: libref_array.so.1()(64bit) for package: gssproxy-0.4.1-7.el7.x86_64
  --&gt; Processing Dependency: libini_config.so.3()(64bit) for package: gssproxy-0.4.1-7.el7.x86_64
  --&gt; Processing Dependency: libcollection.so.2()(64bit) for package: gssproxy-0.4.1-7.el7.x86_64
  --&gt; Processing Dependency: libbasicobjects.so.0()(64bit) for package: gssproxy-0.4.1-7.el7.x86_64
  ---&gt; Package keyutils.x86_64 0:1.5.8-3.el7 will be installed
  ---&gt; Package libevent.x86_64 0:2.0.21-4.el7 will be installed
  ---&gt; Package libnfsidmap.x86_64 0:0.25-12.el7 will be installed
  ---&gt; Package libtirpc.x86_64 0:0.2.4-0.6.el7 will be installed
  ---&gt; Package quota.x86_64 1:4.01-11.el7_2.1 will be installed
  --&gt; Processing Dependency: quota-nls = 1:4.01-11.el7_2.1 for package: 1:quota-4.01-11.el7_2.1.x86_64
  --&gt; Processing Dependency: tcp_wrappers for package: 1:quota-4.01-11.el7_2.1.x86_64
  ---&gt; Package rpcbind.x86_64 0:0.2.0-33.el7_2.1 will be installed
  --&gt; Processing Dependency: libsystemd.so.0(LIBSYSTEMD_209)(64bit) for package: rpcbind-0.2.0-33.el7_2.1.x86_64
  --&gt; Processing Dependency: libsystemd.so.0()(64bit) for package: rpcbind-0.2.0-33.el7_2.1.x86_64
  --&gt; Running transaction check
  ---&gt; Package device-mapper.x86_64 7:1.02.84-14.el7 will be updated
  --&gt; Processing Dependency: device-mapper = 7:1.02.84-14.el7 for package: 7:device-mapper-event-1.02.84-14.el7.x86_64
  ---&gt; Package device-mapper.x86_64 7:1.02.107-5.el7_2.5 will be an update
  ---&gt; Package krb5-libs.x86_64 0:1.11.3-49.el7 will be updated
  ---&gt; Package krb5-libs.x86_64 0:1.13.2-12.el7_2 will be an update
  ---&gt; Package libbasicobjects.x86_64 0:0.1.1-25.el7 will be installed
  ---&gt; Package libcollection.x86_64 0:0.6.2-25.el7 will be installed
  ---&gt; Package libini_config.x86_64 0:1.2.0-25.el7 will be installed
  --&gt; Processing Dependency: libpath_utils.so.1(PATH_UTILS_0.2.1)(64bit) for package: libini_config-1.2.0-25.el7.x86_64
  --&gt; Processing Dependency: libpath_utils.so.1()(64bit) for package: libini_config-1.2.0-25.el7.x86_64
  ---&gt; Package libref_array.x86_64 0:0.1.5-25.el7 will be installed
  ---&gt; Package libverto-tevent.x86_64 0:0.2.5-4.el7 will be installed
  --&gt; Processing Dependency: libtevent.so.0(TEVENT_0.9.9)(64bit) for package: libverto-tevent-0.2.5-4.el7.x86_64
  --&gt; Processing Dependency: libtalloc.so.2(TALLOC_2.0.2)(64bit) for package: libverto-tevent-0.2.5-4.el7.x86_64
  --&gt; Processing Dependency: libtevent.so.0()(64bit) for package: libverto-tevent-0.2.5-4.el7.x86_64
  --&gt; Processing Dependency: libtalloc.so.2()(64bit) for package: libverto-tevent-0.2.5-4.el7.x86_64
  ---&gt; Package quota-nls.noarch 1:4.01-11.el7_2.1 will be installed
  ---&gt; Package systemd-libs.x86_64 0:208-11.el7_0.2 will be updated
  --&gt; Processing Dependency: systemd-libs = 208-11.el7_0.2 for package: systemd-208-11.el7_0.2.x86_64
  ---&gt; Package systemd-libs.x86_64 0:219-19.el7_2.11 will be an update
  ---&gt; Package tcp_wrappers.x86_64 0:7.6-77.el7 will be installed
  --&gt; Running transaction check
  ---&gt; Package device-mapper-event.x86_64 7:1.02.84-14.el7 will be updated
  ---&gt; Package device-mapper-event.x86_64 7:1.02.107-5.el7_2.5 will be an update
  --&gt; Processing Dependency: device-mapper-event-libs = 7:1.02.107-5.el7_2.5 for package: 7:device-mapper-event-1.02.107-5.el7_2.5.x86_64
  ---&gt; Package libpath_utils.x86_64 0:0.2.1-25.el7 will be installed
  ---&gt; Package libtalloc.x86_64 0:2.1.5-1.el7_2 will be installed
  ---&gt; Package libtevent.x86_64 0:0.9.26-1.el7_2.1 will be installed
  ---&gt; Package systemd.x86_64 0:208-11.el7_0.2 will be updated
  --&gt; Processing Dependency: systemd = 208-11.el7_0.2 for package: systemd-sysv-208-11.el7_0.2.x86_64
  --&gt; Processing Dependency: systemd = 208-11.el7_0.2 for package: libgudev1-208-11.el7_0.2.x86_64
  ---&gt; Package systemd.x86_64 0:219-19.el7_2.11 will be an update
  --&gt; Processing Dependency: kmod &gt;= 18-4 for package: systemd-219-19.el7_2.11.x86_64
  --&gt; Running transaction check
  ---&gt; Package device-mapper-event-libs.x86_64 7:1.02.84-14.el7 will be updated
  ---&gt; Package device-mapper-event-libs.x86_64 7:1.02.107-5.el7_2.5 will be an update
  ---&gt; Package kmod.x86_64 0:14-9.el7 will be updated
  ---&gt; Package kmod.x86_64 0:20-5.el7 will be an update
  ---&gt; Package libgudev1.x86_64 0:208-11.el7_0.2 will be updated
  ---&gt; Package libgudev1.x86_64 0:219-19.el7_2.11 will be an update
  ---&gt; Package systemd-sysv.x86_64 0:208-11.el7_0.2 will be updated
  ---&gt; Package systemd-sysv.x86_64 0:219-19.el7_2.11 will be an update
  --&gt; Processing Conflict: systemd-219-19.el7_2.11.x86_64 conflicts initscripts &lt; 9.49.28-1
  --&gt; Restarting Dependency Resolution with new changes.
  --&gt; Running transaction check
  ---&gt; Package initscripts.x86_64 0:9.49.17-1.el7 will be updated
  ---&gt; Package initscripts.x86_64 0:9.49.30-1.el7_2.2 will be an update
  --&gt; Processing Conflict: systemd-219-19.el7_2.11.x86_64 conflicts dracut &lt; 033-243
  --&gt; Restarting Dependency Resolution with new changes.
  --&gt; Running transaction check
  ---&gt; Package dracut.x86_64 0:033-161.el7 will be updated
  --&gt; Processing Dependency: dracut = 033-161.el7 for package: dracut-config-rescue-033-161.el7.x86_64
  --&gt; Processing Dependency: dracut = 033-161.el7 for package: dracut-network-033-161.el7.x86_64
  ---&gt; Package dracut.x86_64 0:033-360.el7_2.1 will be an update
  --&gt; Running transaction check
  ---&gt; Package dracut-config-rescue.x86_64 0:033-161.el7 will be updated
  ---&gt; Package dracut-config-rescue.x86_64 0:033-360.el7_2.1 will be an update
  ---&gt; Package dracut-network.x86_64 0:033-161.el7 will be updated
  ---&gt; Package dracut-network.x86_64 0:033-360.el7_2.1 will be an update
  --&gt; Finished Dependency Resolution
  
  Dependencies Resolved
  
  ================================================================================
   Package                     Arch      Version                 Repository  Size
  ================================================================================
  Installing:
   nfs-utils                   x86_64    1:1.3.0-0.21.el7_2.1    updates    371 k
  Updating:
   dracut                      x86_64    033-360.el7_2.1         updates    311 k
   initscripts                 x86_64    9.49.30-1.el7_2.2       updates    429 k
  Installing for dependencies:
   gssproxy                    x86_64    0.4.1-7.el7             base        84 k
   keyutils                    x86_64    1.5.8-3.el7             base        54 k
   libbasicobjects             x86_64    0.1.1-25.el7            base        24 k
   libcollection               x86_64    0.6.2-25.el7            base        40 k
   libevent                    x86_64    2.0.21-4.el7            base       214 k
   libini_config               x86_64    1.2.0-25.el7            base        59 k
   libnfsidmap                 x86_64    0.25-12.el7             base        46 k
   libpath_utils               x86_64    0.2.1-25.el7            base        27 k
   libref_array                x86_64    0.1.5-25.el7            base        26 k
   libtalloc                   x86_64    2.1.5-1.el7_2           updates     34 k
   libtevent                   x86_64    0.9.26-1.el7_2.1        updates     33 k
   libtirpc                    x86_64    0.2.4-0.6.el7           base        85 k
   libverto-tevent             x86_64    0.2.5-4.el7             base       9.0 k
   quota                       x86_64    1:4.01-11.el7_2.1       updates    178 k
   quota-nls                   noarch    1:4.01-11.el7_2.1       updates     90 k
   rpcbind                     x86_64    0.2.0-33.el7_2.1        updates     58 k
   tcp_wrappers                x86_64    7.6-77.el7              base        78 k
  Updating for dependencies:
   device-mapper               x86_64    7:1.02.107-5.el7_2.5    updates    252 k
   device-mapper-event         x86_64    7:1.02.107-5.el7_2.5    updates    167 k
   device-mapper-event-libs    x86_64    7:1.02.107-5.el7_2.5    updates    169 k
   device-mapper-libs          x86_64    7:1.02.107-5.el7_2.5    updates    305 k
   dracut-config-rescue        x86_64    033-360.el7_2.1         updates     50 k
   dracut-network              x86_64    033-360.el7_2.1         updates     90 k
   kmod                        x86_64    20-5.el7                base       114 k
   krb5-libs                   x86_64    1.13.2-12.el7_2         updates    843 k
   libgudev1                   x86_64    219-19.el7_2.11         updates     66 k
   systemd                     x86_64    219-19.el7_2.11         updates    5.1 M
   systemd-libs                x86_64    219-19.el7_2.11         updates    358 k
   systemd-sysv                x86_64    219-19.el7_2.11         updates     53 k
  
  Transaction Summary
  ================================================================================
  Install  1 Package  (+17 Dependent packages)
  Upgrade  2 Packages (+12 Dependent packages)
  
  Total size: 9.8 M
  Downloading packages:
  Running transaction check
  Running transaction test
  
  
  Stderr from the command:
  
  
  
  Transaction check error:
    file /usr/lib/systemd/system/blk-availability.service from install of device-mapper-7:1.02.107-5.el7_2.5.x86_64 conflicts with file from package lvm2-7:2.02.105-14.el7.x86_64
    file /usr/sbin/blkdeactivate from install of device-mapper-7:1.02.107-5.el7_2.5.x86_64 conflicts with file from package lvm2-7:2.02.105-14.el7.x86_64
    file /usr/share/man/man8/blkdeactivate.8.gz from install of device-mapper-7:1.02.107-5.el7_2.5.x86_64 conflicts with file from package lvm2-7:2.02.105-14.el7.x86_64
  
  Error Summary
  -------------
  </code></pre>
  
  <hr>
  
  <p>I've no idea why this is happening, since I'm not very familiar with <code>vagrant</code>, lets say that I've used it like twice or 3 times. My first question is then: why is this exactly happening?</p>
  
  <p>Note I think I know what NFS is, i.e. it should be a file system that is mounted on the guest machine which allows the same machine and the host machine to share folders and files, right?</p>
  
  <hr>
  
  <p>I was unable to solve this problem until I found the following article:</p>
  
  <blockquote>
    <p><a href="https://access.redhat.com/solutions/158883" rel="nofollow">yum update or yum install fails with package conflict between 64 bit and 32 bit package architectures?</a></p>
  </blockquote>
  
  <p>whose title seems to be, at least for me, completely unrelated to the problem above. </p>
  
  <p>I realized that after the failure of the command above, the vagrant machine had been initialized actually, and that I could connect to it using <code>vagrant ssh</code>, which is what I did. Then, <em>from within the guest vagrant machine</em> (after <code>vagrant ssh</code>), I executed the following commands (which are the same commands that were specified in the article I've just mentioned):</p>
  
  <pre><code>sudo yum install yum-utils
  sudo package-cleanup --dupes
  sudo package-cleanup --cleandupes
  </code></pre>
  
  <p>Added this line: </p>
  
  <pre><code>exactarch=1
  </code></pre>
  
  <p>to the file <code>/etc/yum.conf</code>, and finally</p>
  
  <pre><code>yum clean all
  sudo yum update
  </code></pre>
  
  <p>I exited from the vagrant machine by typing <code>exit</code>. I did <code>vagrant halt</code> to stop the machine. And I re-executed the initial command:</p>
  
  <pre><code>vagrant up --provision-with ansible
  </code></pre>
  
  <p>and the error didn't occur anymore.</p>
  
  <p>My second question is then: why did executing the commands in the tutorial above and that I also mentioned explicitly above solve the problem? </p>
  
  <p>When executing the command to remove duplicate packages, I noticed that the output was that, in reality, there were no duplicate packages. It seems, in my case, that the only commands that actually solve the problem were (<em>not sure though</em>):</p>
  
  <pre><code>yum clean all
  sudo yum update
  </code></pre>
  
  <p>Why would this actually solve the problem? </p>
  
  <hr>
  
  <p>One of my ideas is that the box is actually outdated, since updating pre-installed packages to the latest versions solved apparently the problem...</p>