Sorry, but I don’t want to use VIM to edit files on my Synology NAS. I have no clue why the good people of Synology forgot to put the nano editor on the machine, but I want it there. But… there is no package manager nor a C compiler present on the system¬†?. So let’s fix that by installing the Entware package manager.

These scripts only work on DSM 6+.¬†I’m assuming that you already have a working SSH terminal to your NAS. If you break stuff, you are on your own¬†?. A lot of the scripts will run as root.

Preparation

Entware needs to land somewhere, this will create the right directory:

# create a home for Entware
mkdir -p /volume1/@Entware/opt
# go on as root
sudo -i
# remove a previous install
rm -rf /opt
# link the folders
ln -sf /volume1/@Entware/opt /opt
echo "Done!"

Determine architecture

Run the following script to discover your processor and architecture:

\
printf "\nProcessor:   "; \
cat /proc/cpuinfo | \
grep "model name" | \
grep "[^:]*$" -o  | \
uniq; \
printf "Architecture: "; \
uname -m; \
printf "\n"

I’m using a DS218+, so the script shows that the processor is an¬†Intel(R) Celeron(R) CPU J3355 @ 2.00GHz and the architecture is x86_64 – something I would expect with this processor. (My Raspberry Pi 3 returns¬†ARMv7 Processor rev 4 (v7l) /¬†armv7l)

Install Entware by script

Now that you have the architecture figured out, you know what script you’ll need to run. These script need to run as root.

  • armv5 wget -O - http://bin.entware.net/armv5sf-k3.2/installer/generic.sh | /bin/sh
  • armv7 wget -O - http://bin.entware.net/armv7sf-k3.2/installer/generic.sh | /bin/sh
  • armv8 wget -O - http://bin.entware.net/aarch64-k3.10/installer/generic.sh | /bin/sh
  • x64 wget -O - http://bin.entware.net/x64-k3.2/installer/generic.sh | /bin/sh

If you install the wrong link, don’t worry. Just run the previous step and the right script.

Start Entware at startup

Let’s write the startup file using a script. This startup file is only for DS6+ installations.

# leave root
exit;
# remove previous file
rm entware-startup.sh 2> /dev/null
# write the startup file
printf "#!" >> entware-startup.sh
echo "/bin/sh" >> entware-startup.sh
echo "" >> entware-startup.sh
echo "case $1 in" >> entware-startup.sh
echo "    start)" >> entware-startup.sh
echo "    mkdir -p /opt" >> entware-startup.sh
echo "    mount -o bind /volume1/@Entware/opt /opt" >> entware-startup.sh
echo "    /opt/etc/init.d/rc.unslung start" >> entware-startup.sh
echo "    ;;" >> entware-startup.sh
echo "    stop)" >> entware-startup.sh
echo "    ;;" >> entware-startup.sh
echo "esac" >> entware-startup.sh
# copy the startup file
sudo mv entware-startup.sh /usr/local/etc/rc.d/entware-startup.sh
echo "Done!"

Add to profile and reboot

Before we are done, we need to add some stuff to the profile. This makes sure the package manager is part of your PATH when you use the terminal. We will also reboot the machine.

sudo -i
echo "" >> /etc/profile;
echo ". /opt/etc/profile" >> /etc/profile
reboot

And finally… it’s installation time!

Now we can install all the packages we want. Let’s install nano:

sudo opkg install nano

Easy peasy!