0

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:

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

1 Answer 1

1

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.

10
  • I edited my PATH before asking this question. That's not the problem. Commented Aug 4, 2014 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
    Commented Aug 4, 2014 at 18:57
  • I edited for root, and it didn't work directly after editing PATH, but how to change path persistent? Commented Aug 4, 2014 at 19:01
  • 2
    Ok. What is the output of which vim as user? What is the output of echo $PATH as root?
    – Bex
    Commented Aug 4, 2014 at 19:03
  • output of wich vim:/usr/bin/vim $PATH:/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin Commented Aug 4, 2014 at 19:07

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

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