Simple linux console text editor wanted

mcedit

@mpapis I got mcedit going and learned a lot in the process. For the benefit of other linux newbies I would like to share what I learned.

This is how I installed mcedit on my system which is a Centos 5.5 minimum build running in a VPS.

mcedit screenshot

Starting mcedit

To start mcedit from a console, do;

mcedit

If mcedit is installed it will start and your screen will look like the screenshot above. But if you get an error message like;

No such file or directory

then you need to install mcedit.

Installing mcedit

mcedit is part of a package called mc. To install mcedit you must install mc. To install mc do;

apt-get install mc

If apt-get knows about mc, then you will be asked a question like;

After this operation, 17.4MB of additional disk space will be used.
Do you want to continue [Y/n]?

Go ahead and install it by pressing the 'y' key then then the 'enter' key.

But if you get an error message like;

 Package mc has no installation candidate

then apt-get doesn't know about mc, so you have to tell apt-get about mc. mc is stored in the universe repository. To tell apt-get about mc, you need to tell apt-get where the universe repository is. The universe repository is a popular and safe ubuntu repository.

Tell apt-get about the universe repository

The /etc/apt/sources.list file tells apt-get what repositories are where. You can view sources.list by doing;

more /etc/apt/sources.list

For apt-get to know about the universe repository, the sources.list file must contain the line;

deb http://archive.ubuntu.com/ubuntu/ jaunty universe 

Add the above line to the sources.list file by doing;

echo deb http://archive.ubuntu.com/ubuntu/ jaunty universe >> /etc/apt/sources.list

The ">>" means append the preceding text to the specified file.

To check whether the above has worked, show sources.list by doing;

more /etc/apt/sources.list

If it worked, the last line of the file will be;

deb http://us.archive.ubuntu.com/ubuntu/ jaunty universe

Now tell apt-get about the change you just made to the sources.list file by doing;

apt-get update

You should see;

Reading package lists... Done

So you can now do;

apt-get install mc

Then run mcedit by doing;

mcedit

And you should see the screenshot above.


pico or nano should do fine - joe is also pretty straight forward. vi/vim and emacs have somewhat of a learning curve, but both are worth the invested time.

Tags:

Linux