LinuxQuestions.org
Visit Jeremy's Blog.
Home Forums Tutorials Articles Register
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Newbie
User Name
Password
Linux - Newbie This Linux forum is for members that are new to Linux.
Just starting out and have a question? If it is not in the man pages or the how-to's this is the place!

Notices


Reply
  Search this Thread
Old 06-15-2012, 09:56 PM   #1
Caljoones
LQ Newbie
 
Registered: Jun 2012
Posts: 4

Rep: Reputation: Disabled
Vi is refusing to save!


Hello everyone!
I have recently installed a command line only version of Ubuntu on a desktop, for the purpose of setting up a Minecraft server. Anyway. I've been trying to edit the interfaces file,for the purpose of giving myself a static IP, using the Vi editor. But, any time I try to save I get this message. "E212: Can't open file for writing." Any help??
 
Old 06-15-2012, 10:10 PM   #2
nixblog
Member
 
Registered: May 2012
Posts: 426

Rep: Reputation: 53
You probably dont have permission to write the changes. You will have to launch vi using sudo,

Code:
sudo vi /etc/network/interfaces
and this should give you the elevated (root) permission to alter that file.
 
Old 06-15-2012, 10:11 PM   #3
Caljoones
LQ Newbie
 
Registered: Jun 2012
Posts: 4

Original Poster
Rep: Reputation: Disabled
Quote:
Originally Posted by nixblog View Post
You probably dont have permission to write the changes. You will have to launch vi using sudo,

Code:
sudo vi /etc/network/interfaces
and this should give you the elevated (root) permission to alter that file.
Oh sorry, left that out, thats what I used.
 
Old 06-15-2012, 10:21 PM   #4
nixblog
Member
 
Registered: May 2012
Posts: 426

Rep: Reputation: 53
Have you tried this to save it,

Code:
:w !sudo tee % > /dev/null
 
Old 06-16-2012, 12:28 AM   #5
ac_kumar
Member
 
Registered: Aug 2011
Distribution: Ubuntu, Fedora
Posts: 175

Rep: Reputation: 9
can you show ls -l of file
 
Old 06-16-2012, 03:15 PM   #6
Caljoones
LQ Newbie
 
Registered: Jun 2012
Posts: 4

Original Poster
Rep: Reputation: Disabled
Never Mind, I found it out xD
 
Old 06-16-2012, 04:58 PM   #7
clocker
Member
 
Registered: Sep 2011
Distribution: fedora, redhat, mint
Posts: 87

Rep: Reputation: Disabled
vi has two modes the insert and esc mode to save a file you should be in the esc mode the type.
Quote:
:w filename
like folks have said you should have rwx rights.
 
Old 06-16-2012, 05:21 PM   #8
Snark1994
Senior Member
 
Registered: Sep 2010
Distribution: Debian
Posts: 1,632
Blog Entries: 3

Rep: Reputation: 346Reputation: 346Reputation: 346Reputation: 346
Quote:
Originally Posted by Caljoones View Post
Never Mind, I found it out xD
Well done - please mark the thread as 'SOLVED' and, if applicable, post the solution so people can benefit from your answer. Thanks!
 
Old 06-16-2012, 07:16 PM   #9
whysoserious
Member
 
Registered: May 2012
Location: London
Distribution: Debian and slackware for uni
Posts: 61

Rep: Reputation: Disabled
Lol at nixblog haha. By the way what did you do if it was not a permissions problem?
 
  


Reply



Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off



Similar Threads
Thread Thread Starter Forum Replies Last Post
[SOLVED] Transferring from save file to save partition hda7 Puppy 2 05-04-2010 08:11 AM
Refusing connections? linker1981 Linux - Networking 4 07-19-2006 09:16 AM
keep refusing connections tpark Linux - Networking 1 03-04-2004 02:24 AM
X Refusing to start Sheriff Linux - Newbie 1 01-04-2004 09:30 PM
Refusing Connections goldfish Linux - Newbie 16 10-09-2003 06:13 PM

LinuxQuestions.org > Forums > Linux Forums > Linux - Newbie

All times are GMT -5. The time now is 06:19 AM.

Main Menu
Advertisement
My LQ
Write for LQ
LinuxQuestions.org is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
Syndicate
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
Open Source Consulting | Domain Registration