DEV Community

Cover image for Install `nano` on EdgeOS (2.x)
Wietse Wind
Wietse Wind

Posted on

Install `nano` on EdgeOS (2.x)

If you want to edit a (config) file on EdgeOS (2.X.X), you can. EdgeOS comes with vi. Not the easiest editor to get started with, especially if you just want to update a simple setting in eg. a OpenVPN client config file.

To make editing the occasional file a bit easier, you can install the nano package from the Debian repositories. To do that, SSH into your EdgeRouter:

ssh {your-webinterface-username}@{your-router-ip} -p 22
Enter fullscreen mode Exit fullscreen mode

Eg. ssh johndoe@192.168.1.1 -p 22

When logged in, start configuration mode:

configure
Enter fullscreen mode Exit fullscreen mode

Now set the Debian system package, by issuing these commands in the configuration mode:

set system package repository stretch components 'main contrib non-free' 
set system package repository stretch distribution stretch
set system package repository stretch url http://http.us.debian.org/debian
Enter fullscreen mode Exit fullscreen mode

Apply the configuration by committing, save and exit:

commit; save; exit
Enter fullscreen mode Exit fullscreen mode

Now update the system package cache:

sudo apt-get update
Enter fullscreen mode Exit fullscreen mode

Do NOT upgrade system packages, that will break some of the packages your EdgeRouter depends on!

You can now install nano:

sudo apt-get install nano
Enter fullscreen mode Exit fullscreen mode

Now nano is installed, we can remove the apt-cache, and remove the Debian repository again from the config:

sudo rm -R /var/lib/apt/lists
sudo rm -R /var/cache/apt/archives
Enter fullscreen mode Exit fullscreen mode

Enter the configuration mode again, and remove the Debian system package repository:

configure
delete system package repository stretch
commit; save; exit
Enter fullscreen mode Exit fullscreen mode

Enjoy using nano for a quick config file edit :)

Top comments (1)

Collapse
 
nnyan profile image
Nnyan

Thank you for this guide! When I do the step to install nano I get the following:

The following extra packages will be installed:
libc6 libncurses5 libncursesw5 libtinfo5
Suggested packages:
glibc-doc libc-l10n locales spell
Recommended packages:
libgpm2
The following NEW packages will be installed:
nano
The following packages will be upgraded:
libc6 libncurses5 libncursesw5 libtinfo5
4 upgraded, 1 newly installed, 0 to remove

I'm not sure if all of these are new or being upgraded since it's not clear. I don't want to upgrade system packages as you said.

Thank you