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
Eg. ssh johndoe@192.168.1.1 -p 22
When logged in, start configuration mode:
configure
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
Apply the configuration by committing, save and exit:
commit; save; exit
Now update the system package cache:
sudo apt-get update
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
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 the configuration mode again, and remove the Debian system package repository:
configure
delete system package repository stretch
commit; save; exit
Top comments (1)
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