Giuseppe Parrello


How to install Entware on a NAS device

In this section I describe how to install Entware on a NAS device (Synology DS412+).
Firstly we access the NAS via SSH or Telnet. We create a new folder on "volume1" of the first disk (where Synology's DSM is installed), we remove the old "/opt" folder (in following example "/opt" folder does not exist), and we link the "/opt" folder to the new created folder :

root@DS412:~# mkdir -p /volume1/@entware/opt
root@DS412:~# rm -rf /opt
rm: cannot remove ‘/opt’: Device or resource busy
root@DS412:~# mkdir -p /opt
root@DS412:~# mount -o bind /volume1/@entware/opt /opt

Now we have to know the correct Entware's platform to use, according to NAS device we have. Firstly we have to know all the basics informations of NAS :

root@DS412:~# uname -a
Linux DS412 3.10.35 #5967 SMP Fri Nov 3 17:20:59 CST 2017 x86_64 GNU/Linux synology_cedarview_412+

In the following table we can know all the output's form - for Synology devices we can have additional informations on this website :

LinuxOperating System's name
DS412Host's name
3.10.35Operating System's release
#5967 SMP Fri Nov 3 17:20:59 CST 2017Operating System's version
x86_64The machine (hardware) type
GNU/LinuxOperating System
synology_cedarview_412+Synology's Hardware Architecture

Briefly we can know the current Hardware Type with following command line :

root@DS412:~# uname -m

Briefly we can know the current Kernel version with following command line :

root@DS412:~# uname -r

Then we open a browser, we go to this website and we find some subfolders, we have to choose one of those folders in order to install Entware. This is the list of the most important subfolders we can have, please be careful to choose the proper subfolder according to above-mentioned output for Hardware Type and Kernel version :

SubfolderHardware Type + Kernel versionSynology's Package Arch
aarch64-k3.10armv8 - kernel 3.10 and higherrtd1296
armv5sf-k3.2armv5 - kernel 3.2 and higher88f628x
armv7sf-k2.6armv7 - kernel 2.6.36 and higher 
armv7sf-k3.2armv7 - kernel 3.2 and higherArmada*, Alpine*, Comcerto*
mipselsf-k3.4mipsel - kernel 3.4 and higher 
mipssf-k3.4mips - kernel 3.4 and higher 
x64-k3.2x86_64 - kernel 3.2 and higherAll Intel CPU Models except X86

For device Synology DS412+ we have to choose "x64-k3.2" subfolder, so we execute the following command line in order to install Entware (instead you have to replace "x64-k3.2" with your subfolder) :

root@DS412:~# wget -O - | /bin/sh

--2018-06-06 10:56:50--
Connecting to||:80... connected.
HTTP request sent, awaiting response... 200 OK
Length: 2208 (2.2K) [application/octet-stream]
Saving to: 'STDOUT'
Info: Checking for prerequisites and creating folders...
Warning: Folder /opt exists!
2018-06-06 10:56:50 (125 KB/s) - written to stdout [2208/2208]

Info: Opkg package manager deployment...
--2018-06-06 10:56:50--
Connecting to||:80... connected.
HTTP request sent, awaiting response... 200 OK
Length: 158016 (154K) [application/octet-stream]
Saving to: '/opt/bin/opkg'
2018-06-06 10:56:51 (796 KB/s) - '/opt/bin/opkg' saved [158016/158016]

--2018-06-06 10:56:51--
Connecting to||:80... connected.
HTTP request sent, awaiting response... 200 OK
Length: 182 [application/octet-stream]
Saving to: '/opt/etc/opkg.conf'
2018-06-06 10:56:51 (9.48 KB/s) - '/opt/etc/opkg.conf' saved [182/182]

--2018-06-06 10:56:51--
Connecting to||:80... connected.
HTTP request sent, awaiting response... 200 OK
Length: 157488 (154K) [application/octet-stream]
Saving to: '/opt/lib/'
2018-06-06 10:56:51 (662 KB/s) - '/opt/lib/' saved [157488/157488]

--2018-06-06 10:56:51--
Connecting to||:80... connected.
HTTP request sent, awaiting response... 200 OK
Length: 1759664 (1.7M) [application/octet-stream]
Saving to: '/opt/lib/'
2018-06-06 10:56:52 (1.65 MB/s) - '/opt/lib/' saved [1759664/1759664]

--2018-06-06 10:56:52--
Connecting to||:80... connected.
HTTP request sent, awaiting response... 200 OK
Length: 92560 (90K) [application/octet-stream]
Saving to: '/opt/lib/'

--2018-06-06 10:56:53--
Connecting to||:80... connected.
HTTP request sent, awaiting response... 200 OK
Length: 106152 (104K) [application/octet-stream]
Saving to: '/opt/lib/'

2018-06-06 10:56:53 (734 KB/s) - '/opt/lib/' saved [106152/106152]

Info: Basic packages installation...
Updated list of available packages in /opt/var/opkg-lists/entware
Installing entware-opt (227000-3) to root...
Installing libc (2.27-8) to root...
Installing libgcc (7.3.0-8) to root...
Installing libssp (7.3.0-8) to root...
Installing librt (2.27-8) to root...
Installing libpthread (2.27-8) to root...
Installing libstdcpp (7.3.0-8) to root...
Installing entware-release (1.0-2) to root...
Installing zoneinfo-asia (2018e-1) to root...
Installing zoneinfo-europe (2018e-1) to root...
Installing findutils (4.6.0-1) to root...
Installing terminfo (6.1-1) to root...
Installing locales (2.27-8) to root...
Installing grep (2.26-1) to root...
Installing libpcre (8.41-2) to root...
Installing opkg (2011-04-08-9c97d5ec-17b) to root...
Installing entware-upgrade (1.0-1) to root...
Configuring libgcc.
Configuring libc.
Configuring libssp.
Configuring libpthread.
Configuring librt.
Configuring terminfo.
Configuring libpcre.
Configuring grep.
Configuring locales.
Entware uses separate locale-archive file independent from main system
Creating locale archive - /opt/usr/lib/locale/locale-archive
Adding en_EN.UTF-8
Adding ru_RU.UTF-8
You can download locale sources from
You can add new locales to Entware using /opt/bin/
Configuring entware-upgrade.
Upgrade operations are not required
Configuring opkg.
Configuring zoneinfo-europe.
Configuring zoneinfo-asia.
Configuring libstdcpp.
Configuring entware-release.
Configuring findutils.
Configuring entware-opt.
Info: Congratulations!
Info: If there are no errors above then Entware was successfully initialized.
Info: Add /opt/bin & /opt/sbin to your PATH variable
Info: Add '/opt/etc/init.d/rc.unslung start' to startup script for Entware services to start
Info: Found a Bug? Please report at

Now we have to create a script that our NAS must execute whenever it is restarted.
Firstly we must create the following file "/etc/rc.entware" :

#! /bin/sh

if test -z "${REAL_OPT_DIR}"; then

case "$1" in
          echo "Starting Entware."
          if test -n "${REAL_OPT_DIR}"; then
               if ! grep ' /opt ' /proc/mounts >/dev/null 2>&1 ; then
                    mkdir -p /opt
                    mount -o bind ${REAL_OPT_DIR} /opt
                    /opt/etc/init.d/rc.unslung start
          echo "Shutting down Entware."
          echo "Usage: $0 {start|stop|reconfig}"
          exit 1

exit 0

In the above-mentioned file, the line "/opt/etc/init.d/rc.unslung start" is required to automatically start the Entware services. If you do not want to automatically start the Entware services, you can remove that line. Eventually instead of that line, you can manually insert the services to be started during boot.
Then we add the following single line to file "/etc/rc.local" - if this file does not exist, we create it :


[ -x /etc/rc.entware ] && /etc/rc.entware start

exit 0

Now we have to add the folders "/opt/bin" and "/opt/sbin" at the end of the PATH environment variable, using one of the files "/root/.profile" or "/etc/profile" ("/etc/profile" for DSM6), this is an example of PATH line:

export PATH

Please do not add the above-mentioned folders at the beginning of the PATH line to avoid any problems for NAS device. Remember that Entware is just an additional environment for the NAS, so it is better to let NAS find its own files inside the standard PATH folders before Entware folders.
Please reboot the NAS device so to test all the changes you have done.
After rebooting the NAS device, we can install all the Entware packages we need, for example if we want to install "Nano" editor, we can use the command "opkg install nano".

root@DS412:~# opkg install nano
Installing nano (2.9.6-1) to root...
Installing libncursesw (6.1-1) to root...
Installing zlib (1.2.11-2) to root...
Installing file (5.25-2) to root...
Installing libmagic (5.25-2) to root...
Configuring libncursesw.
Configuring zlib.
Configuring libmagic.
Configuring file.
Configuring nano.

To update all packages we will use the two commands "opkg update" and "opkg upgrade" (the first command updates the Internet source of packages, the second one upgrades only the updated packages). We need to take care about the upgrade of packages, because it is happened to me in the past that some configurations files (changed by me) were overwritten by the default configuration files. My suggestion is to make a backup of all "/opt" folder before upgrading the packages (but also periodically in order to have a backup copy of Entware installation whenever we need to restore some files).
Another my suggestion is to use the parameter "--noaction" with the command "opkg upgrade", in this way we may see a simulation (testing) of the upgrading procedure, just to know in advance which packages will be upgraded, which files will be overwritten and if there is something we have to do in advance in order to have a full-functional Entware environment after upgrading the packages.

This is a sample output of command "opkg update":

root@DS412:~# opkg update

Updated list of available packages in /opt/var/opkg-lists/entware

This is a sample output of command "opkg --help":

root@DS412:~# opkg --help

usage: opkg [options...] sub-command [arguments...]
where sub-command is one of:

Package Manipulation:
	update 		 	Update list of available packages
	upgrade 	 	Upgrade installed packages
	install <pkgs> 	 	Install package(s)
	configure <pkgs> 	Configure unpacked package(s)
	remove <pkgs|regexp> 	Remove package(s)
	flag <flag> <pkgs> 	Flag package(s)
	 <flag>=hold|noprune|user|ok|installed|unpacked (one per invocation)

Informational Commands:
	list			List available packages
	list-installed 		List installed packages
	list-upgradable 	List installed and upgradable packages
	list-changed-conffiles 	List user modified configuration files
	files <pkg> 		List files belonging to <pkg>
	search <file|regexp> 	List package providing <file>
	find <regexp> 		List packages whose name or description matches <regexp>
	info [pkg|regexp] 	Display all info for <pkg>
	status [pkg|regexp] 	Display all status for <pkg>
	download <pkg> 		Download <pkg> to current directory
	compare-versions 	<v1> <op> <v2>
				compare versions using <= < > >= = << >>
	print-architecture 	List installable package architectures
	depends [-A] [pkgname|pat]+
	whatdepends [-A] [pkgname|pat]+
	whatdependsrec [-A] [pkgname|pat]+
	whatrecommends[-A] [pkgname|pat]+
	whatsuggests[-A] [pkgname|pat]+
	whatprovides [-A] [pkgname|pat]+
	whatconflicts [-A] [pkgname|pat]+
	whatreplaces [-A] [pkgname|pat]+

	-A 			Query all packages not just those installed
	-V[<level>] 		Set verbosity level to <level>.
	--verbosity[=<level>] 	Verbosity levels:
					0 errors only
					1 normal messages (default)
					2 informative messages
					3 debug
					4 debug level 2
	-f <conf_file> 		Use <conf_file> as the opkg configuration file
	--conf <conf_file>
	--cache <directory> 	Use a package cache
	-d <dest_name> 		Use <dest_name> as the the root directory for
	--dest <dest_name> 	package installation, removal, upgrading.
				<dest_name> should be a defined dest name from
				the configuration file, (but can also be a
				directory name in a pinch).
	-o <dir> 		 Use <dir> as the root directory for
	--offline-root <dir> 	 offline installation of packages.
	--add-arch <arch>:<prio> Register architecture with given priority
	--add-dest <name>:<path> Register destination with given path
Force Options:
	--force-depends		Install/remove despite failed dependencies
	--force-maintainer	Overwrite preexisting config files
	--force-reinstall	Reinstall package(s)
	--force-overwrite	Overwrite files from other package(s)
	--force-downgrade	Allow opkg to downgrade packages
	--force-space		Disable free space checks
	--force-postinstall	Run postinstall scripts even in offline mode
	--force-remove		Remove package even if prerm script fails
	--force-checksum	Don't fail on checksum mismatches
	--noaction		No action -- test only
	--download-only		No action -- download only
	--nodeps		Do not follow dependencies
	--nocase		Perform case insensitive pattern matching
	--size			Print package size when listing available packages
				Remove package and all dependencies
	--autoremove		Remove packages that were installed
				automatically to satisfy dependencies
	-t			Specify tmp-dir.
	--tmp-dir		Specify tmp-dir.
	-l			Specify lists-dir.
	--lists-dir		Specify lists-dir.

 regexp could be something like 'pkgname*' '*file*' or similar
 e.g. opkg info 'libstd*' or opkg search '*libop*' or opkg remove 'libncur*'