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

  • Try whereis vagrant – ryekayo Jun 9 '17 at 12:52
  • @ryekayo - vagrant: /usr/bin/vagrant /opt/vagrant/bin/vagrant – aspirinemaga Jun 9 '17 at 12:59
  • Ok you need to update the init script your using to have it point to /usr/bin/vagrant. Right now it's pointed to /usr/local/bin/vagrant – ryekayo Jun 9 '17 at 13:00
  • could you send me more info please ? I am null in this scenario – aspirinemaga Jun 9 '17 at 13:02
  • What command do you use to start vagrant? – ryekayo Jun 9 '17 at 13:03

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.
  • Ok, I will try your suggestion and will answer you. thank you – aspirinemaga Jun 9 '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 9 '17 at 13:13
  • Cool, if my answer works, would you mind checking it off :-) – ryekayo Jun 9 '17 at 13:13
  • Would be nice also, if you could update your answer with my additional information to solve this problem. – aspirinemaga Jun 9 '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 9 '17 at 13:16

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.