Glam Prestige Journal

Bright entertainment trends with youth appeal.

A few hours earlier I bought a beaglebone and now I am trying to add nameserver 8.8.8.8 to /etc/resolv.conf. However when I open it with vim and try to add my nameserver, it gives me E21: cannot make changes, 'modifiable' is off. I changed permissions via chmod. chmod u+rx /etc/resolv.conf But nothing changed. I am still unable to write into resolv.conf file. What should I do?

2

5 Answers

From vim documentation:

If you make changes to a file and forgot that it was read-only, you can still write it. Add the ! to the write command to force writing.

If you really want to forbid making changes in a file, do this:

vim -M file

Now every attempt to change the text will fail. The help files are like this, for example. If you try to make a change you get this error message:

E21: Cannot make changes, 'modifiable' is off 

You could use the -M argument to setup Vim to work in a viewer mode. This is only voluntary though, since these commands will remove the protection:

:set modifiable
:set write
3

/etc/resolv.conf is owned by root, so you must edit it as root (using sudo):

sudo vim /etc/resolv.conf

You might want to back it up first though:

sudo cp /etc/resolv.conf /etc/resolv.conf.old

If you prefer to edit it graphically, then instead of using vim, you can use:

gksu gedit /etc/resolv.conf

Or on Kubuntu:

kdesudo kate /etc/resolv.conf

If you changed /etc/resolv.conf's permissions, you should change them back, as the default permissions prevent unauthorized access while allowing authorized access as explained above.

However, it's likely you didn't really change any permissions, since by default (at least on Ubuntu 12.04 LTS) /etc/resolv.conf is actually a symbolic link to /run/resolvconf/resolv.conf.

2

(Disclaimer: this is based on Internet research, not on actual hands-on experience with the board.)

According to this article,

Ångström Linux distribution [...] is included in the microSD card packaged with each Beaglebone.

Without citing the whole article (it seems to be very well written, btw.) you need to:

  1. SSH into your Beagleboard as root.
  2. Edit /etc/network/interfaces.
  3. Add dns-nameservers 8.8.8.8.
  4. Run /etc/init.d/networking restart

If your settings seem to work, but go away after a reboot, read this article on setting up Connman.

You'll need to install the connman-tests package to enable command-line configuration of Connman, and set the nameservers by following the instructions.

Example:

./set-nameservers ethernet_405fc276b749_cable 8.8.8.8

Just press Ctrl+Alt+T on your keyboard to open Terminal. When it opens, run the commands below.

gksudo gedit /etc/resolv.conf

That will let you modify the file and save it.

You can try:

opkg update
opkg install gedit 
1

You can try:

vim resolv.conf

Save it after that

rm -rf /etc/resolv.conf

Then move resolv.conf file in /etc/

mv resolv.conf /etc/

Your Answer

Sign up or log in

Sign up using Google Sign up using Facebook Sign up using Email and Password

Post as a guest

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy