Currently Online

We have 21 guests online
None

Login

             | 

Search

Like it? Share it!

How to Install GNU Nano Text Editor on GoDaddy Shared Deluxe Linux Hosting with SSH Access

linux - Tutorials

User Rating: / 7
PoorBest 

Before we begin and I tell you how to go about installing GNU/Nano text editor on GoDaddy Shared Deluxe Linux hosting account, let me give you a little history of about Nano.  Nano is a clone of Pico, so lets talk about Pico a bit.

What is Pico?
Pico is a ncurses based  text editor for Unix and Unix/Linux computer systems. It is integrated with the Pine e-mail client, which was designed by the Office of Computing and Communications at the University of Washington.

Pine's message composition text editor is also down-loadable  as a separate program, called PICO. PICO is a very simple and easy-to-use intuitive text editor offering paragraph justification, cut/paste, and a spelling checker.

Pico does not currently support working with multiple files at the same time and cannot do a search/replace across multiple files. It also cannot copy text from one file to another.

Other popular Unix text editors such as vi and Emacs provide a significantly greater number of features than Pico, including regex based search/replace and working with multiple files at the same time. However the learning curve is high due to this very reason.  With the proliferation of GNU/Linux in the mid to late 90's, many University students became intimately familiar with the strengths (and weaknesses) of Pine and Pico.  I was one of them. Though only 14 years old at the time, I was a Pico lover.

What is GNU nano?
GNU nano is designed to be a free replacement for the Pico text editor, part of the Pine email suite from The University of Washington. It aims to "emulate Pico as closely as possible and perhaps include extra functionality".

The GNU (GNU's Not Unix) /Backronym/ project has a clone of the Pico Editor called Nano. Nano was developed because Pico's license was not free.  It does not conform to the Free Software Guidelines as set forth by GNU and DFSG, the Debian Free Software Guidelines.  Since distribution of a modified version of the Pico editor and its code was expressly forbidden, nano was written from scratch to mimic Pico as much by default to replicate the environment users are used to.

Then came Debian...
The Debian GNU/Linux distribution, for which I maintain packages, provide support on IRC (for over 9 years... so I know first hand the stricness of freedom), known for its strict standards in distributing truly "free" software (i.e. software with no restrictions on redistribution), would not include a binary package for Pine or Pico. Many people had a serious problem starting now: they loved using the said softwares, but the software versions available at the time did not truly meet free software guidelines in the GNU world.

The event...
In late 1999 Chris Allegretta started to dislike and complain about the non-free Pico license, its thousand and one makefiles, and how just a couple of tiny additions and improvements could make it the fastest and the Best Editor in the World (TM).

One day something just happened, it clicked within Chris's mind.  He took it upon himself and hacked and coded and cursed and swore up and down like a madman for many hours straight one weekend to make a baby infant Pico clone which was hardly usable.  It was called TIP (Tip Isn't Pico) at the time. Again it is a Backronym like GNU. The binary at the time could not be called without specifying a filename, nor could it save files or provided any help text screens.  It did not include a spell checker, and so forth. But as time went by Nano improved, and with the help of a few great coders it matured to the (hopefully) stable state it is today.

In February 2001, nano was declared an official GNU program by Richard Stallman. Nano also reached its first production release on March 22, 2001.

Note:  N is not capitalized.  It is called 'nano'. You can view the manpage of nano here @ nano On-line Manpage

Now that I've finally talked about what was really on my mind, about why I love Pico and well... now nano.  nano is by far the best text editor I've used.  It maybe due to the fact that it was my absolute first unix text editor at the age of 14, and I have a special bond developed with Pico.  As such I can't live without it on any system that I am working on.  When I say Pico, I really mean nano.  I can't live without nano.

So here it is, now I'm going to finally tell you HOW to get nano installed on your GoDaddy Deluxe Shared Linux hosting account.  This tutorial does not cover a VPS or a dedicated machine, as on those machine you actually have access as root to yum, so you can actually install it via yum using rpm packages. However, we are installing on a Shared Hosting account, with SSH enabled, where you have absolutely no access to GCC or any other compilers, and nano or Pico are not installed by default. The only text editors available are VIm and Emacs.

Anyway, lets get started.

First, enable SSH access to your account.  Read my tutorial Enabling-SSH-on-Your-GODADDY-Deluxe-Linux-Shared-Hosting-Account on how to enable SSH.
Secondly, SSH into your account.  ssh This e-mail address is being protected from spambots. You need JavaScript enabled to view it
I also use the -C command line switch just to enable compression over the sometimes laggy/slow connection.

Now, we must find out what our server is running.  As far as I know, godaddy always uses CentOS (Redhat Enterprise Linux) and their current version is at 5.  Lets confirm this.

$>uname -a
Linux ServerName 2.6.18-92.1.10.el5PAE #1 SMP Tue Aug 5 08:14:05 EDT 2008 i686 i686 i386 GNU/Linux

You will get similar output.  This actually doesn't tell us much of anything other than our kernel version and architecture type.

Let us try

$>cat /proc/version
Linux version 2.6.18-92.1.10.el5PAE ( This e-mail address is being protected from spambots. You need JavaScript enabled to view it )
(gcc version 4.1.2 20071124 (Red Hat 4.1.2-42)) #1 SMP Tue Aug 5 08:14:05 EDT 2008

Alright, so we now know that this server is running Red Hat EL 4 (CentOS 5).  However, I'm still not fully sure exactly which version this is, as one place mentions centos.org and another mentions Red Hat.  I should mention that I am a Debian GNU/Linux maintainer and contributor exclusively, and I am unfamiliar with Redhat.  The last Redhat I used was 6.2 in the mid 1990s.  Anyway, lets try something else...

$>cat /etc/redhat-release
CentOS release 5.2 (Final)

AHA! Bingo.  We have nailed our Operating System version on this GoDaddy server.

Since I have no access to compilers, and I have no root access, I have to figure out a way to get nano installed on this server.  What do you think we can do?

Since you know that nano is only dependant on curses and libc, we can be quite sure that the dependencies are already satisfied on the server.  All we really need to do, is to find a precompiled CENTOS/RHEL nano binary and upload it to our account.

Go here and download the nano-2.0.9-1.i386.rpm located at http://www.nano-editor.org/dist/v2.0/RPMS/nano-2.0.9-1.i386.rpm with the description "Binary RPM for i386 platform (RH 8.0)"

Once you have downloaded this RPM file, you must unpack it.  If you are using  Microsoft Windows, then I can't help you as I don't use Windows.  If you are on Debian GNU/Linux more power to you, if not, any other flavor of linux/unix will work just fine as well.  To learn how to unpack the RPM archive, please read my article on how to do so.

After you  have read the article, and extracted the files from the RPM package, you must go into the /usr/bin directory and copy this 'nano' binary file to your server's shell account.

Go ahead and login to your GoDaddy shell account on your Deluxe Shared Linux hosting server and switch to your home directory as follows

$>cd ~/

Now we need to make a directory here where we need to store our nano binary. So go ahead and create the following directory

$>mkdir -p ~/bin

Now copy your nano binary here using scp.

$>scp username@yourip:/path/to/the/extracted/nano ~/bin/

This will connect to your Linux machine and copy the nano binary you specified to the ~/bin/ directory on your GoDaddy account.  If you want to copy files via FTP or through their File Manager interface via the Hosting Control Center, it is also fine.  Just find a way to create this directory and copy the nano binary there.

After you have done this, the last thing you need to do is to add ~/bin to your global $PATH environment variable. First make sure GoDaddy hasn't already enabled  ~/bin in your $PATH. I am quite positive that GoDaddy has already enabled ~/bin in your $PATH.  Check it by typing

$>echo $PATH

Look at the output.  You should see your a path to your home directory and the bin directory added already.  If in case GoDaddy has not enabled ~/bin in your $PATH, you can simply put it in there.  Find our what your exact working directory is first.

$>cd ~/
$>pwd

pwd stands for Print Working Directory.  It outputs the full path to where your $USER home is located.  It should be something like /home/content/a/t/i/atirjavid/ (this is GoDaddy's account naming schema)

Edit ~/.bashrc (Create this file if it does not already exist) and append to the bottom of the file on a NEW BLANK LINE

export PATH=$PATH:/home/content/a/t/i/atirjavid/bin

Obviously of course you will substitute the above command with the correct path to your home directory.

Now we have just added ~/bin to your $PATH variable.  Before you can launch nano, you must reload your ~/.bashrc file, or manually export the $PATH.  You can simply reload the ~/.bashrc by typing

$>source ~/.bashrc

Now you can launch the nano text editor in all its glory from anywhere within the system.

This nano editor that I am in love with is extremely customizable.  Just go to google, and research ".nanorc" and read the nano documentation and the man page.  After which you can simply create ~/.nanorc file and put all your settings in there.

Thanks for reading so far guys.  I hope this helped in some way.  Stay tuned to read my next article on how to fully customize the nano text editor, add syntax hilighting for various different languages and file types, enable the spell checker, and configure nano to be used with the actual mouse.

My Twitter

atirjavid's avatar
Atir Javid atirjavid
  • bio:
    C.E.O Frosted Web, Social Media Marketing & Development | C.T.O. Sky Social Media Inc, former Debian contributor, maintainer and developer. Currently w/FreeBSD.
  • web:
  • location:
    Baton Rouge, LA. USA
  • updates:
    389
  • followers:
    136
  • following:
    15
Last 4 following:
runev's avatar emiltofan's avatar CalEvans's avatar fabpot's avatar
Loading...

Last 0 tweets in past 30 days from atirjavid:

People talking about '@Linux':

Quick Links

CopyLeft Notice

Distribution of the Original Works

You’re free to copy and redistribute the copylefted work — either by itself, or as part of a larger collection of works. All you have to do is (1) be honest - by clearly crediting me as the author, and only redistributing accurate copies of the original (But you don't REALLY have to :) hehe )- and (2) keep it free - by distributing the copy under the same copyleft license, and including either a copy of the license, or a reference to its URL (http://creativecommons.org/licenses/by-sa/1.0/legalcode).

You don’t have to copyleft your whole newsletter to reprint a single article of mine in it (although copylefting your whole newsletter is certainly worthwhile on its own merits). You only have to distribute the copy of my work under the copyleft terms. You’re also free to distribute abridged, translated, or otherwise edited copies of my works — but these count as derivative works, not copies of the original.

Derivative Works

You’re also free to make and distribute derivative works from the copylefted work (such as abridged or edited copies of original works, stories about characters introduced in the original works, etc.). All you have to do is (1) be honest — by clearly identifying your work as a derivative work, and clearly crediting me as the author of the original work on which it was based (But you don't REALLY have to do that either :) Hehehe) — and (2) keep it free — by distributing your derivative work as free content under the terms of the same copyleft license under which the original work was distributed. Please read the (The GNU General Public License ). Thank you very much.

Credit me or don't. Just please keep the information free and flowing.