Problem with sudo vi ~/.bashrc from "Ardupilot Installation part 1" video


#1

So I’ve been following this tutorial and I am trying to access the vim editor the same way he is but I’m getting the following screen when it should look like his. All my text is in white and I can’t figure out what I’m doing wrong.

Here is my terminal before I am typing sudo vi ~/.bashrc


#2

So, I ended up editing with nano instead just to see what would happen. All my text is still white so I’m assuming my color scheme is just messed up because I added the export PATH line to the bottom of the text and I can successfully path to from other directories. I just really don’t know why my editor color schemes are janky :confused:


#3

Hi there Jarrod!

Can you run “sudo which vi” and “which vi”?

If either returns “/bin/vi” then it looks like you’re using the lightweight vi version.

Hope this helps!


#4

Wow thanks so much! This is correct that it returns ‘/bin/vi’ but I’m having trouble figuring out fixing this still. If you have any insight that’s awesome but I can also likely figure it out from other forums now that I know what the problem is.


#5

I’m having the same issue with the sudo vi ~/.bashrc command. My code is similar to Jarrod’s with it being white, but mine isn’t allowing me to add the export PATH. Any suggestions?

Here’s what my code looks like:

usr/bin/vi was returned after using the command “sudo which vi”, but I’m not sure how to troubleshoot that. I’ve tried a few of the solutions in the link to serverfault.com, but none have seemed to work.


#6

maybe install vim

sudo apt install vim

Should have color.
Looks like you have repetitive lines which can be removed using ‘C’ command
Enter proper line (as below), or just use echo command. Remember to follow with source command.

cd ~
mkdir courseRoot
sudo echo “export courseRoot= /home/$USER/courseRoot” >> ~/.bashrc
source .bashrc


#7

Thanks for the reply jax200! I installed vim and that seemed to work, but when I tried to correct the repetitive lines, this is what I’m seeing. This is also the same message I got the first few times I tried to set up the courseRoot directory:

The problem occurs when I use the source .bashrc command. Any suggestions on how to get around that, or how to fix it?


#8

Sorry, not sure on that one. btw, I see in my original response I added a space between ‘=’ and ‘/’ which would have created the error. But you did avoid that so it is curious. Perhaps you can post the question on one of the programming forums like stackoverflow, stackexchange, quora, superuser, etc.


#9

Hi there @oliviaR

@jax200 is right, adding the space before and after the = will create the error. Make sure to remove the previous entries you had for courseRoot in your .bashrc file