DEV Community

Peter Cooper
Peter Cooper

Posted on

3

How to Install the `nano` Text Editor on AWS CloudShell

I know the basics of vim and I even know how to exit it(!) but I'd much rather use GNU Nano as my editor at the terminal. Yet, the Amazon Linux 2 distribution with AWS CloudShell doesn't include it!

Here's what to do to install it into your home folder so that it remains in place long-term:

# Install basic developer tools and dependencies
sudo yum -y groupinstall "Development Tools"
sudo yum -y install git-core zlib zlib-devel gcc-c++ patch readline readline-devel libffi-devel openssl-devel make bzip2 autoconf automake libtool bison curl sqlite-devel xz

# Download and compile nano
cd ~
mkdir ~/bin
wget https://www.nano-editor.org/dist/v5/nano-5.4.tar.xz
tar xf nano-5.4.tar.xz
cd nano-5.4
./configure --prefix=$HOME
make && make install

# Clean up and add ~/bin to PATH
cd ..
rm -rf nano-5.4
rm nano-5.4.tar.xz
echo 'export PATH="$HOME/bin:$PATH"' >> ~/.bash_profile
source ~/.bash_profile
Enter fullscreen mode Exit fullscreen mode

Now you can run nano:

nano
Enter fullscreen mode Exit fullscreen mode

Heroku

Deliver your unique apps, your own way.

Heroku tackles the toil — patching and upgrading, 24/7 ops and security, build systems, failovers, and more. Stay focused on building great data-driven applications.

Learn More

Top comments (1)

Collapse
 
ericardiansa profile image
EricArdiansa

thank you.. really helpful

Image of Quadratic

Free AI chart generator

Upload data, describe your vision, and get Python-powered, AI-generated charts instantly.

Try Quadratic free

👋 Kindness is contagious

Please leave a ❤️ or a friendly comment on this post if you found it helpful!

Okay