LibreELEC entware installation (opkg / optware)

Published on Author Artem Butusov13 Comments


LibreELEC is perfect linux distro for running Kodi almost everywhere.

LibreELEC has a powerful add-on system and it also has docker container support so technically you could run everything you need inside docker container.

But sometimes it is not enough. All (or almost all) Linux distros have their own package manager with set of well known packages (prebuilt binaries or scripts to build from source code).

Well, LibreELEC has its own build system and you could use it to add support for other packages but in that case you will have to rebuild almost whole LibreELEC.

Building customized version of LibreELEC could be overkill if you just need to install something like Midnight Commander or cron, right?

Here is one possible solution – use entware:

entware is an tiny and minimalistic user-space prefix (/opt) environment designed for embedded systems with tiny package manager.

There are other optware-like alternatives, but I found that entware is supported better than others.


  • optware / optware-ng:
  • entware-ng: no more an option, merged with entware
  • entware-ng-3.x: no more an option, merged with entware

Fix LibreELEC image

To be able to easy work with entware we will need folder in root /opt. LibreELEC uses read only root filesystem so we will have to fix system image.

My LibreELEC is installed on SD card and I also have OS X on my laptop.


  • OS X (but it could be Linux too but instruction how to install squashfs is different)
  • Homebrew package manager installed:
  • In terminal: brew install squashfs


  • Disconnect SD card
  • Connect SD card to OS X
  • Connected volume should have label “LIBREELEC”
  • Open terminal
cd /Volumes/LIBREELEC
mkdir -p new/opt
mksquashfs new SYSTEM -all-root
rm -rf new
  • Thats it, now SYSTEM image should have /opt directory and you could connect SD card back to your media player
  • You will need to do this step each time you will update LibreELEC system image.

Connect to LibreELEC over SSH

Enable SSH access in LibreELEC configuration or during setup. Remember hostname, by default, it is LibreELEC.

Run from terminal: ssh root@LibreELEC.local (or CustomHostname.local)

Install entware

Root filesystem is still unreadable, but /storage has read-write access, so we could install entware into, for example, /storage/opt and bind /opt to /storage/opt (thats why we created /opt in the root).

You could find correct install script url here: In my case I will use AARCH64 standard install script (for ODROID-C2).

Install opkg:

mkdir -p /storage/opt
mount -o bind /storage/opt /opt
wget -O - | sh
export PATH=$PATH:/opt/bin:/opt/sbin
opkg update
# expr is used in opkg init scripts and is not available in busybox provided by LibreELEC
opkg install coreutils-expr

Make /opt bind persistent:

Run: nano -w /storage/.config/system.d/opt.mount

Please note, filename opt.mount make sense here (systemd rule): /{name} -> {name}.mount.




Enable mount point to be activated on reboot:

systemctl enable opt.mount

Fix profile to have entware available in SSH session by default and enable unicode:

Run: nano /storage/.profile

export LC_ALL=en_US.UTF-8
export LANG=en_US.UTF-8
export LANGUAGE=en_US.UTF-8

export PATH=$PATH:/opt/bin:/opt/sbin

Now you could reboot LibreELEC and test if changes are persistent. After reboot you should be able to:

  • connect to LibreELEC over SSH
  • see that /opt is mounted. ls /opt should show files (test for /opt bind)
  • opkg list should show list of available packages (test for PATH in profile)

Enable SSH with certificate

Run on local machine:

nano ~/.ssh/config

Paste configuration to use alternative username when you are connecting to LibreELEC (we assume default hostname here):

Host libreelec.local
    User root

Run on local machine:

cat ~/.ssh/*.pub

Login to libreelec thru ssh:

ssh root@libreelec.local

Copy the open key you would like to use.

nano -w ~/.ssh/authorized_keys

Paste the open key.


Exit SSH session and try to login again:

ssh libreelec.local

This time it should not ask for password.


Now you could install packages available in entware with opkg package manager.

  • opkg list will show list of available packages.
  • opkg list | grep package will help you to find needed package.
  • opkg install package will install package
  • some packages are designed to be daemonized, for example cron.
    • init scripts are located here: /opt/etc/init.d
    • you could start service with /opt/etc/init.d/SXX{name} start
    • you could stop service with /opt/etc/init.d/SXX{name} stop
    • services should be also wrapped into systemd config files to persist their state on reboot
  • opkg uninstall package will uninstall package


midnight commander (application)

Install mc: opkg install mc

Thats it 🙂

cron (service)

Install cron: opkg install cron

Wrap service into systemd config: nano -w /storage/.config/system.d/cron.service


ExecStart=/opt/etc/init.d/S10cron start
ExecStop=/opt/etc/init.d/S10cron stop


Auto start service on reboot: systemctl enable cron.service

Start service now: systemctl start cron.service

This is a perfect example how easy could be to install binary package with entware.

dnsmasq (service)

Below is example how to setup dnsmasq with ads blacklist.

Download ads domains blacklist in hosts file format:

cd /opt/etc && wget

Install dnsmasq: opkg install dnsmasq-full

Run: nano -w /opt/etc/dnsmasq.conf


Wrap service into systemd config: nano -w /storage/.config/system.d/dnsmasq.service


ExecStart=/opt/etc/init.d/S56dnsmasq start
ExecStop=/opt/etc/init.d/S56dnsmasq stop


Auto start service on reboot: systemctl enable dnsmasq.service

Start service now: systemctl start dnsmasq.service

Now you could set for any device at home main DNS server address to LibreELEC ip address and all (almost) ads will be removed.

Another perfect example how easy is entware.

vsftpd (service)

By default, LibreELEC has no ftp support but ftp could be useful for some iOS/Android apps with bad samba support, VLC, for example.

Here we could setup guest read-only ftp with a few commands:

Install vsftpd: opkg install vsftpd-ext

Run: nano -w /opt/etc/vsftpd/vsftpd.conf

# defaults - everything else could be disabled

# overrides

This config will make vsftpd share all mounted devices.

Wrap service into systemd config: nano -w /storage/.config/system.d/vsftpd.service


ExecStart=/opt/etc/init.d/S49vsftpd start
ExecStop=/opt/etc/init.d/S49vsftpd stop


Auto start service on reboot: systemctl enable vsftpd.service

Start service now: systemctl start vsftpd.service

13 Responses to LibreELEC entware installation (opkg / optware)

  1. Thank you for this guide. I followed it on my mac so everything should work. I would like to install shairport-sync on Rasplex which is based on LibreELEC.
    I get stuck at the line opkg update. I get: Illegal instruction (core dumped)
    I’ve tried this on a fresh LibreELEC install as well to see if that makes any difference but I get the same error.

    Could you please help to find a solution?

    Thank you.

    • Illegal instruction means that you are trying to use binaries from another architecture. What hardware do you have? You need to pick right architecture during opkg bootstrap.

      • Thank you for your reply. Yes, I’ve tried to install on the wrong architecture, I’m using a Pi zero W, which is armv6.
        I could make it work on a RPi 3, however, I’m still struggling to make shairport-sync work and also I couldn’t make the mount of /opt persistent.

  2. Thank you for the guide, worked flawlessly!
    Entware-ng-3x works great also in LibreELEC running on my Rock64.
    Do you know if it’s possible to patch it to not expect /opt ? Would save a lot of steps when updating LibreELEC.

  3. The vsftpd instructions say we need to run nano -w /opt/etc/dnsmasq.conf
    You probably mean nano -w /opt/etc/vsftpd.conf?

  4. Dear Artem, thanks so much for your guide here, it’s helped me tremendously to get my Slice with upgrade to Raspberry Pi Compute Module 3 running as a way more sophisticated box!

    I’d like to propose two small corrections to the ‘Install entware’ section:

    Please update the URL for the install script to ‘’, so that it becomes wget -O - | sh.
    I recommend to change the exported PATH to export PATH=/opt/bin:/opt/sbin:$PATH, because more often than not, the point of installing an entware package is to override the executable in /usr/bin/ that came with busybox with a (better) alternative.

    So far it seems like I’ve got the perfect setup with this, so I’m very happy – thanks again!

Leave a Reply

Your email address will not be published. Required fields are marked *

This site uses Akismet to reduce spam. Learn how your comment data is processed.