Linux package manager on Synology

Linux package manager on Synology

Packages, packages, packages! When you have been using your Synology NAS or Network device for some time. You often use the command line to get certain things done. And if you are a Linux user, you have already realized it. Only some commands you are used to are available. So what we need is a Synology Linux Package Manager.

Synology devices cannot install additional packages. And no, I’m not talking about the package available in the package center. I’m talking about Linux packages that add other programs to your system. Let’s take a famous Linux distribution as an example. In Ubuntu Linux, a user can type apt install <package>, and it will be installed. This is what needs to be added to Synology. So let’s add this.

What is a package manager?

A package manager or package-management system is a collection of software tools that automatically install, upgrade, configure, and remove computer programs for a computer consistently.
[Source: wikipedia.com]

An example is the apt program on a ubuntu Linux distribution where a user gives the command apt install <package> to have the package manager install it. Synology does not have this out of the box. So we will have to make do with a community-driven package manager for embedded devices.

What is EntWare?

Entware is a software repository for embedded devices that use the Linux kernel, primarily routers and network-attached storage. It has long been the practice of manufacturers for these devices to “overpower” them relative to the functions they are designed to perform. (It’s generally more profitable to provide the extra computational margin than bear the cost of increased support for those who more heavily tax them.) Installing Entware can allow users to take advantage of this extra computing power by adding software to the device, which permits it to perform new tasks, provide other features besides those they were marketed for, or perform those functions better.

Over 2,500 packages are currently available, ranging from language interpreters like Python v3 and Perl v5 to the most fundamental Unix-like tools such as grepawk and sed. All packages are compiled for use on eight of the most commonly used architecture toolchains to the extent which they are compatible; expand the collapsed section below to see a table which lists all of the architecture and toolchain combinations with links to a searchable package index for each.

Packages

To browse the packages of EntWare, you need to know your platform. So, you can find your platform by running the following command from SSH. uname -m. EntWare supported more platforms; correspondingly, see the next section. But only for some platforms is there a package index available.

PlatformPackage Index
armv5Browse Packages
armv7Browse Packages
armv8 / aarch64Browse Packages
mips / mipselBrowse Packages
x86Browse Packages
x86_64Browse Packages
Package indexes for EntWare supported platforms

Supported Platforms

  • armv5
  • armv71
  • aarch64
  • mips
  • mipsel
  • x86
  • x86_64

Check if my Synology is supported

You can just run the following command to check if your Synology is a supported platform and check the result against the supported platform list above; you’ll need to check this through SSH, these commands need to be run as root.

uname -m

The next check is to check the root system. Run the following command. If the value is greater than or equal to 600 your device is supported.

stat -c '%a' /opt

Prepare system for EntWare

Firstly, we need to make some changes to our system to load EntWare, and execute the following steps from SSH as the root user. Switch to root with the sudo -i command. If you need help, read my terminal access post first.

  1. Create EntWare folder
mkdir -p /volume1/@Entware/opt
  1. Remove /opt folder and mount the EntWare folder
rm -rf /opt
mkdir /opt
mount -o bind /volume1/@Entware/opt /opt
Mount failure

If the mount command fails, then please replace try to use a symbolic link instead.

ln -s /volume1/@Entware/opt/ /opt

Install EntWare

  1. Presently, we are ready to install EntWare and get our package manager up and running. Correspondingly, run the installer command depending on your platform. However, you can check which platform you have withe the command uname -m.
armv5
wget -qLO - https://bin.entware.net/armv5sf-k3.2/installer/generic.sh | /bin/sh
armv71
wget -qLO - https://bin.entware.net/armv7sf-k3.2/installer/generic.sh | /bin/sh
armv8 / aarch64
wget -qLO - https://bin.entware.net/aarch64-k3.10/installer/generic.sh | /bin/sh
mips
wget -qLO - https://bin.entware.net/mipssf-k3.4/installer/generic.sh | /bin/sh
mipsel
wget -qLO - https://bin.entware.net/mipselsf-k3.4/installer/generic.sh | /bin/sh
x86
wget -qLO - https://bin.entware.net/x86-k2.6/installer/generic.sh | /bin/sh
x86_64
wget -qLO - https://bin.entware.net/x64-k3.2/installer/generic.sh | /bin/sh

EntWare Boot-Up

Finally, is ensuring EntWare is loaded at the boot-up of your Synology. Consequently, this is achieved by using a triggered task.

  1. Login in to DSM as an administrator
  2. Open Control Panel
  3. Open Task Scheduler
  4. Create > Triggered Task > User Defined Script
    • General:
      • Task Name: Enable EntWare
      • User: root
      • Event: Boot-up
      • Pre-task: none
    • Task Settings:
      • Run Command:
#!/bin/sh

# Mount EntWare
mkdir -p /opt
mount -o bind /volume1/@Entware/opt /opt
/opt/etc/init.d/rc.unslung start

# Add EntWare Profile in Global Profile
if grep  -qF  '/opt/etc/profile' /etc/profile; then
	echo "Confirmed: EntWare Profile in Global Profile"
else
	echo "Adding: EntWare Profile in Global Profile"
cat >> /etc/profile <<"EOF"

# Load EntWare Profile
[ -r "/opt/etc/profile" ] && . /opt/etc/profile
EOF
fi

# Update EntWare List
/opt/bin/opkg update
  1. Click OK to save the task
  2. Click OK to confirm the confirmation dialog.
  3. Reboot your NAS, and enjoy your Linux package manager.

Final thoughts

This guide helped you in setting up EntWare on your Synology. Lastly, leave a comment or send me an email with suggestions. Enjoy your new package manager on your Synology. Subscribe for more tips & tricks.