Any ideas of running dpkg on OpenWrt?

I'm trying to run dpkg on openwrt x86-64. Im stuck with library errors. Any ideas how to static compile it or fix library missing?

how would we know, w/o any error message ?

Root@OpenWrt:~# ldd /usr/bin/dpkg
        /lib64/ld-linux-x86-64.so.2 (0x7eff7add0000)
Error loading shared library libselinux.so.1: No such file or directory (needed by /usr/bin/dpkg)
        libc.so.6 => /lib64/ld-linux-x86-64.so.2 (0x7eff7add0000)
Error relocating /usr/bin/dpkg: __snprintf_chk: symbol not found
Error relocating /usr/bin/dpkg: __vfprintf_chk: symbol not found
Error relocating /usr/bin/dpkg: setexecfilecon: symbol not found
Error relocating /usr/bin/dpkg: lsetfilecon_raw: symbol not found
Error relocating /usr/bin/dpkg: freecon: symbol not found
Error relocating /usr/bin/dpkg: _obstack_begin: symbol not found
Error relocating /usr/bin/dpkg: selabel_lookup_raw: symbol not found
Error relocating /usr/bin/dpkg: security_getenforce: symbol not found
Error relocating /usr/bin/dpkg: selinux_status_open: symbol not found
Error relocating /usr/bin/dpkg: selabel_open: symbol not found
Error relocating /usr/bin/dpkg: __asprintf_chk: symbol not found
Error relocating /usr/bin/dpkg: obstack_free: symbol not found
Error relocating /usr/bin/dpkg: __vasprintf_chk: symbol not found
Error relocating /usr/bin/dpkg: is_selinux_enabled: symbol not found
Error relocating /usr/bin/dpkg: __vsnprintf_chk: symbol not found
Error relocating /usr/bin/dpkg: __strcpy_chk: symbol not found
Error relocating /usr/bin/dpkg: _obstack_newchunk: symbol not found
Error relocating /usr/bin/dpkg: __printf_chk: symbol not found
Error relocating /usr/bin/dpkg: selinux_status_updated: symbol not found
Error relocating /usr/bin/dpkg: __longjmp_chk: symbol not found
Error relocating /usr/bin/dpkg: selinux_status_close: symbol not found
Error relocating /usr/bin/dpkg: __fprintf_chk: symbol not found
Error relocating /usr/bin/dpkg: selabel_close: symbol not found
Error relocating /usr/bin/dpkg: __sprintf_chk: symbol not found
root@OpenWrt:/usr/bin# ./dpkg
-ash: ./dpkg: Permission denied
root@OpenWrt:/usr/bin#

You can't install Debian packages (including dpkg itself) on OpenWrt, they are not binary compatible. While by far not the only issue, Debian is using glibc as system libc, while OpenWrt is using musl instead, but you will run into ABI incompatibilites with pretty much all other libraries as well.

Whats about alpine packages
And what is permission denied when i try to start file?(executable not shell)

Same.

ELF interpreter expected by the binary is missing, most likely.

If you want to install packages from other distros on OpenWrt, consider setting up a chroot environment. Installing e.g. a Debian chroot on top of OpenWrt should be straightforward using the debootstrap package.

1 Like

Any ideas about compiling packages like X11 for openwrt ABI? I think chroot is (i dont know how it in english, i will say in russian) kinda like "костыль".

Technically possible, but you would have to do the leg work, do the development (and it doesn't stop at X.org, next step would be a window manager, a browser, a...) and long term maintenance. There have been attempts in the past, but they never saw continued maintenance and bit-rotted away, plagued by security issues due to neglect.

You will have to make a decision, do you want a router XOR a desktop - different use cases, different distributions. If you want Debian with X.org/ wayland, then install Debian - setting up nftables/ iptables (mostly) by hand to teach it about routing would be much easier than adding hundreds if new (and extended) packages to add X.org to OpenWrt.

Thousand of problems. Anyway, are there any way to compile desktop applications without changing their source code? And are there any way to run non-x11 graphics applications? Or forward display from docker to real display?

ssh tunnel ?

Another option is run OpenWrt in a systemd-nspawn container within a full desktop system. Or a VM.

No, you dont understud me right. I want to forward docker display to display of openwrt device(pc)

can use ssh tunnel for that as well, question is just why ...

Maybe ssh tunel is great i dont test it. But i want to see screen from docker on my real screen (that connected to openwrt device) i already give hardware graphics acceleration to docker container. But dont see xserver on my screen.