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 |
Welcome to LinuxQuestions.org, a friendly and active Linux Community.
You are currently viewing LQ as a guest. By joining our community you will have the ability to post topics, receive our newsletter, use the advanced search, subscribe to threads and access many other special features. Registration is quick, simple and absolutely free. Join our community today!
Note that registered members see fewer ads, and ContentLink is completely disabled once you log in.
Are you new to LinuxQuestions.org? Visit the following links:
Site Howto |
Site FAQ |
Sitemap |
Register Now
If you have any problems with the registration process or your account login, please contact us. If you need to reset your password, click here.
Having a problem logging in? Please visit this page to clear all LQ-related cookies.
Get a virtual cloud desktop with the Linux distro that you want in less than five minutes with Shells! With over 10 pre-installed distros to choose from, the worry-free installation life is here! Whether you are a digital nomad or just looking for flexibility, Shells can put your Linux machine on the device that you want to use.
Exclusive for LQ members, get up to 45% off per month. Click here for more info.
|
 |
06-15-2012, 09:56 PM
|
#1
|
LQ Newbie
Registered: Jun 2012
Posts: 4
Rep: 
|
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??
|
|
|
06-15-2012, 10:10 PM
|
#2
|
Member
Registered: May 2012
Posts: 426
Rep: 
|
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.
|
|
|
06-15-2012, 10:11 PM
|
#3
|
LQ Newbie
Registered: Jun 2012
Posts: 4
Original Poster
Rep: 
|
Quote:
Originally Posted by nixblog
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.
|
|
|
06-15-2012, 10:21 PM
|
#4
|
Member
Registered: May 2012
Posts: 426
Rep: 
|
Have you tried this to save it,
Code:
:w !sudo tee % > /dev/null
|
|
|
06-16-2012, 12:28 AM
|
#5
|
Member
Registered: Aug 2011
Distribution: Ubuntu, Fedora
Posts: 175
Rep:
|
can you show ls -l of file
|
|
|
06-16-2012, 03:15 PM
|
#6
|
LQ Newbie
Registered: Jun 2012
Posts: 4
Original Poster
Rep: 
|
Never Mind, I found it out xD
|
|
|
06-16-2012, 04:58 PM
|
#7
|
Member
Registered: Sep 2011
Distribution: fedora, redhat, mint
Posts: 87
Rep: 
|
vi has two modes the insert and esc mode to save a file you should be in the esc mode the type.
like folks have said you should have rwx rights.
|
|
|
06-16-2012, 05:21 PM
|
#8
|
Senior Member
Registered: Sep 2010
Distribution: Debian
Posts: 1,632
|
Quote:
Originally Posted by Caljoones
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!
|
|
|
06-16-2012, 07:16 PM
|
#9
|
Member
Registered: May 2012
Location: London
Distribution: Debian and slackware for uni
Posts: 61
Rep: 
|
Lol at nixblog haha. By the way what did you do if it was not a permissions problem?
|
|
|
All times are GMT -5. The time now is 03:46 PM.
|
LinuxQuestions.org is looking for people interested in writing
Editorials, Articles, Reviews, and more. If you'd like to contribute
content, let us know.
|
Latest Threads
LQ News
|
|