I am attempting to modify nsswitch.conf from:

hosts: files dns

to

hosts: dns files

But, it is read-only. I have tried using:

sudo vi /etc/nsswitch.conf

And even with

:w!

It is unable to modify the file. How can I go about doing this? Currently my system is unable to

link|improve this question
feedback

1 Answer

up vote 1 down vote accepted

Change permissions on the file first:

sudo chmod u+w /etc/nsswitch.conf

That will give write permission to the owner (should be root). Then try editing it as you tried before:

sudo vi /etc/nsswitch.conf
link|improve this answer
Tried this, and it gives me the same result, perhaps the chmod is not working? When I attempt it says: Changing permissions of '/...': Read-only file system. Then, when I attempt to save with vim it says: "nsswitch.conf" E212: Can't open file for writing. – Serodis Dec 27 '11 at 16:04
Read-only file system? Are you running from an Ubuntu Live CD? – Doug Harris Dec 27 '11 at 16:41
I am not, I am actually on a VPS, I am trying a reinstall, I'll check back a little later. – Serodis Dec 27 '11 at 16:50
Well, that's quite odd. I've reinstalled and it is no longer a read-only system. Not sure what happened, but everything seems great. Thank you. – Serodis Dec 27 '11 at 17:03
Btw: I will vote you up when I get the reputation. haha. – Serodis Dec 27 '11 at 17:04
feedback

Your Answer

 
or
required, but never shown

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