LinuxQuestions.org

LinuxQuestions.org (/questions/)
-   Linux - Newbie (https://www.linuxquestions.org/questions/linux-newbie-8/)
-   -   No editor, no dns gateway, stucked, help please (https://www.linuxquestions.org/questions/linux-newbie-8/no-editor-no-dns-gateway-stucked-help-please-622564/)

Seregwethrin 02-20-2008 01:13 PM

No editor, no dns gateway, stucked, help please
 
Hello;

There no nano and pico installed.

There's no dns ip entered. I can't connect to domains. Only connect them from their ip's. (I could connect, but i rebooted the computer and after i started to can't connect domains.)

I'm trying to edit the "/etc/resolv.conf" file for dns, but it's really hard to edit it with "vi" editor. I can't find how to save it with "vi" :S

Nano gives error when typed "make" after "./configure"
Code:

...
...
/bin/sh: makeinfo: command not found
make[3]: *** [nano.html] Error 127
make[3]: Leaving directory `/root/nano-2.0.7/doc/texinfo'
make[2]: *** [all-recursive] Error 1
make[2]: Leaving directory `/root/nano-2.0.7/doc'
make[1]: *** [all-recursive] Error 1
make[1]: Leaving directory `/root/nano-2.0.7'
make: *** [all] Error 2

Pine (i think it'll install pico with itself), says type "./configure" to start installing. But there's no configure file for run.

What i can do now :S Please show me a way.

mtimbro 02-20-2008 01:23 PM

I'd strongly suggest you use vi. Here is a quick reference guide:

http://rcsg-gsir.imsb-dsgi.nrc-cnrc....c/node313.html

To save and quit, all you have to do is ':wq' (omit the ticks). There are 2 modes in vi, one for editing (that you can access hitting the letter i) and a command mode (that you can access hitting semi-colon (:)).

If you can't manage, what distro are you using ? Perhaps you can install the pico or nano package instead of compiling...

pljvaldez 02-20-2008 01:24 PM

Try the vi cheat sheet.

forrestt 02-20-2008 01:27 PM

To navigate in vi type:

j = down
k = up
h = left
l = right

to change from cursor location to end of file

"c$" when done making changes "Esc"

When done editing the file

":wq"
(write and quit)

or

":w!
:q"
(force write)
(quit)

If you decide you don't want to change the file:

"q!"

(force quit)

NOTE: Don't include the quotes in any of the above.

Check out:

http://www.adminschoice.com/docs/vi_editor_ref.htm

You REALLY want to learn vi. It is on all systems by default and once you learn it, things are much easier than any other editor you may use (except for possibly emacs, but that is an operating system in my opinion (and no, I have never learned to use emacs)).

HTH

Forrest

Seregwethrin 02-20-2008 01:27 PM

omg, it worked and i saved it :) Thanks friends.

And also how can i add more dnses? I want to add opendns ips', it has two ips.
And only one line in resolv.conf
"nameserver 208.67.222.222"

But i still want to use pico or nano. I'm using centos 4.

And what can i do for makeinfo error?

mrrangerman 02-20-2008 01:29 PM

vi has three main modes, when you want to add text press i look at the bottom of the screen and it should say INSERT make the changes that you need then press Esc to exit instert mode, to save and quit press Ctrl and the collon at the same time. This will allow you to enter commands, type wq then enter to write/save and quit. Make sure you are root user if the file you need to edit needs root permissions.

forrestt 02-20-2008 01:32 PM

Navigate to the nameserver entry with "j"
Type "yy" to yank a line into memory.
Type "p" to put a line from memory.
Hit "j" to go to the line you just put.
Hit "l" (Leter after "k" NOT number before "2") until you go to the first digit in the IP address.
Type "c$" to change the line from that point on.
Type the new IP.
Hit "Esc" key.
Save the file as you did before and exit vi.

HTH

Forrest

chrism01 02-20-2008 06:10 PM

Actually,
:wq
is cargo-cult stuff, it's doing a write, then a quit. just use
:x
means exit-with-save
:q
means quit (ie exit-without-save)
:w <filename>
is used when you want to save the current buffer to another filename (don't actually type the angle brackets)

forrestt 02-20-2008 06:19 PM

chrism01, what can I say, I'm old. :)

jschiwal 02-20-2008 06:26 PM

If you want to use nano, then simply install it. You do need to learn the basics of using vi to be able to safely edit the sudoers file and the passwd file.
visudo is used to edit /etc/sudoers and uses "vim" but adds error checking. The program to edit /etc/passwd safely also uses "vim".

Also, the rescue mode or a rescue disk will have "vim" or "vim-minimal" installed but might not have nano.

There is a "sed" program that you probably will want to learn to use. It is based on the "ed" program which "vim" is based on as well. So if you learn to search and replace in "vim", you will also learn how to do it in "sed" as well.

FYI, you can also use cursor keys in vi. You don't have to use the j,k,l,m keys to navigate. Navigation keys are mostly useful combined with other commands such as :del or :yank. You don't need to learn them if you don't want to. Also the [insert] key will toggle between insert and replace modes as you would expect. You can also press the [Insert] key to quickly get into the edit mode when you start.

chrism01 02-20-2008 06:30 PM

Personally I'm nearly always on X-windows, so I cheat and use the mouse and /or ctrl-c/ctrl-v to copy and paste, but on a console you need the old yank/put combo.


All times are GMT -5. The time now is 06:21 PM.