First, you're not really supposed to do this, you're supposed to recompile a new release with what you want in it.
Second, this really isn't installing, it is just coping files around.
Third, there are security risks as these never get updated, but I don't really expect most people run LibreELEC stuff in production environments.
Fourth, your milage may vary and I guess there's a chance you may mess up your system.
Fifth, not everything will work properly.
Some things I got working:
fdisk
lsar
lsattr
lscpu
lshw
lsipc
lslocks
lslogins
lsns
lsof
lspci
lsusb
pfetch
Stuff which did not work for me:
neofetch
htop
top
screen
You'll need to enable SSH on your device, on my Lakka machine I was getting an error after enabling ssh:
Permission denied (publickey,password,keyboard-interactive)
- I boot it off a different Linux Live USB
- Mounted the root partition.
- Generated ssh keys using
ssh-keygen
setting the path tomountpoint/storage/.ssh
- Added an
authorized_keys
file in thestorage/.ssh
folder. - Added the keys from my server and laptop to the
authorized_keys
file.
This method can be used to try whatever commands you want, assuming you have a linux machine you can copy them from.
I wanted to use fdisk
in my install of Lakka, but it wasn't included.
mkdir ~/bin ~/lib
echo "export LD_LIBRARY_PATH=/storage/lib:\$LD_LIBRARY_PATH" >> ~/.profile
echo "export PATH=~/bin:\$PATH" >> ~/.profile
echo "" >> ~/.profile
echo "alias l='ls -lah'" >> ~/.profile
echo "" >> ~/.profile
echo "~/bin/pfetch" >> ~/.profile
cd ~/bin
wget "https://raw.githubusercontent.com/dylanaraps/pfetch/master/pfetch"
chmod +x pfetch
source ~/.profile
This should display something like this, different host and memory, of course.
___ root@Lakka
(.. | os Lakka (official): 4.2
(<> | host OptiPlex 7010 01
/ __ \ kernel 5.10.109
( / \ /| uptime 23h 4m
_/\ __)/_) memory 346M / 15929M
\/-____\/
So from here, I copied my fdisk
from my server to ~/bin
with scp
.
From the server:
scp /sbin/fdisk root@10.10.10.100:~/bin
Then in Lakka:
chmod +x ~/bin/fdisk
fdisk -l
This initially throws an error and throws anther later:
fdisk: error while loading shared libraries: libfdisk.so.1: cannot open shared object file: No such file or directory
fdisk: error while loading shared libraries: libtinfo.so.5: cannot open shared object file: No such file or directory
On the server:
sudo find / -type f -name "libfdisk.so.1*"
sudo find / -type f -name "libtinfo.so.5*"
This returns some things icluding:
/lib/x86_64-linux-gnu/libfdisk.so.1.1.0
/lib/x86_64-linux-gnu/libtinfo.so.5.9
So, I pushed them to the Lakka box, renaming them:
scp /lib/x86_64-linux-gnu/libfdisk.so.1.1.0 root@10.10.10.100:~/lib/libfdisk.so.1
scp /lib/x86_64-linux-gnu/libtinfo.so.5.9 root@10.10.10.100:~/lib/libtinfo.so.5
Now on the Lakka box fdisk -l
shows the info:
....
Disk /dev/sda: 465.8 GiB, 500107862016 bytes, 976773168 sectors
Units: sectors of 1 * 512 = 512 bytes
Sector size (logical/physical): 512 bytes / 512 bytes
I/O size (minimum/optimal): 512 bytes / 512 bytes
Disklabel type: gpt
Disk identifier: 9F560225-0EB9-468F-A558-3DB173722932
Device Start End Sectors Size Type
/dev/sda1 2048 976773119 976771072 465.8G Linux filesystem
Disk /dev/sdb: 59.6 GiB, 64023257088 bytes, 125045424 sectors
Units: sectors of 1 * 512 = 512 bytes
Sector size (logical/physical): 512 bytes / 512 bytes
I/O size (minimum/optimal): 512 bytes / 512 bytes
Disklabel type: gpt
Disk identifier: AA5FFD22-348C-42D6-BA9B-B00EA6DBC663
Device Start End Sectors Size Type
/dev/sdb1 8192 4202495 4194304 2G EFI System
/dev/sdb2 4202496 125044400 120841905 57.6G Linux filesystem
Disk /dev/loop0: 948.9 MiB, 994967552 bytes, 1943296 sectors
Units: sectors of 1 * 512 = 512 bytes
Sector size (logical/physical): 512 bytes / 512 bytes
I/O size (minimum/optimal): 512 bytes / 512 bytes