1

I can't install or reinstall a vagrant on CentOS 7.

First, I've followed a tutorial on how to install a Vagrant on CentOS 7 with Ruby & Ruby Gem.

After installation, I've typed inside a terminal a command: vagrant

and I received a message telling me that this method of installation is deprecated, I shall go to vagrantup.com and install an .rpm package instead.

I've did that, but now when I call a command vagrant I have this message: bash: /usr/local/bin/vagrant: No such file or directory

I've tried to uninstall everything to reinstall it from zero, but no success. I can't find any information about to fix this problem.

Any suggestion please ? Thanks

==== UPDATED ====

whereis vagrant outputs following:
vagrant: /usr/bin/vagrant /opt/vagrant/bin/vagrant

Jeff Schaller
  • 67,283
  • 35
  • 116
  • 255

1 Answers1

1

There are two ways you can solve this issue: creating an alias (this is more of a hack) or going to the systemd unit file and modifying it so that it points to the correct location for the binary.

  1. Fixing via ~/.bashrc - This is as simple as creating an alias in the bashrc file and using source to reload. This is a quick fix, but I'd recommend the latter.
  2. Going to the systemd unit file and updating it - There are plenty of resources online to show you how to create and modify systemd unit files. Take a look at this link here for an example on modifying systemd unit files.
ryekayo
  • 4,763
  • Ok, I will try your suggestion and will answer you. thank you – aspirinemaga Jun 09 '17 at 13:03
  • OK i got it, thank you very much ! I've created a command: 1. gedit ~/.bashrc 2. I've added: alias vagrant='/usr/bin/vagrant 3. source ~/.bashrc – aspirinemaga Jun 09 '17 at 13:13
  • Cool, if my answer works, would you mind checking it off :-) – ryekayo Jun 09 '17 at 13:13
  • Would be nice also, if you could update your answer with my additional information to solve this problem. – aspirinemaga Jun 09 '17 at 13:15
  • 1
    Ok alias is one way of going about it. But ultimately, I would recommend going to the source and fixing the systemd unit file. I am going to modify my answer a bit to provide more detail on both options – ryekayo Jun 09 '17 at 13:16