Hey Pi user out there!

I got a Raspberry pi model B with Raspbian Wheezy. I want to play around at init and my Kernel...

But to do this I need to run vim as root. When I start vim this happens:

# vim hosts.allow
-bash: vim: command not found

What's up here?

I installed vim, and with the user pi it's running perfect:

  • I use sudo vi /etc/hosts.allow without any problem – rob Aug 5 '14 at 9:25
  • I reinstalled vim, now everything works fine – LittleByBlue Aug 5 '14 at 9:27

You likely have a problem with your path. Type which vim as the user it works fore, and use the full path as root, or make sure the directory with the program is in root's PATH variable.

|improve this answer|||||
  • I edited my PATH before asking this question. That's not the problem. – LittleByBlue Aug 4 '14 at 18:55
  • Did you edit PATH for root, or for your user? How did you edit it? Did you make the change persistent? – Bex Aug 4 '14 at 18:57
  • I edited for root, and it didn't work directly after editing PATH, but how to change path persistent? – LittleByBlue Aug 4 '14 at 19:01
  • 2
    Ok. What is the output of which vim as user? What is the output of echo $PATH as root? – Bex Aug 4 '14 at 19:03
  • output of wich vim:/usr/bin/vim $PATH:/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin – LittleByBlue Aug 4 '14 at 19:07

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.