How do I install command line tools, such as ‘diff’?
I’ve set up my ZimaBlade with ZimaOS as a NAS, with a USB HDD hanging off for local backups. To test the backups, I’m doing a restore to elsewhere on the HDD, and then I’d like to do something like a “diff -r” across the restored files and the originals. But I don’t have a “diff” on the path.
I’m a Linux veteran but haven’t before used an immutable distro (if that’s the right term?) like ZimaOS before.
For now I’m just ssh-ing in from elsewhere, and doing the diff from there, but presumably doing it over the network is slower than doing it would be running right there on the ‘blade?
Good question, this catches a lot of people on ZimaOS
Short answer: you don’t install tools like diff directly on ZimaOS.
ZimaOS is an immutable / buildroot-style system, so:
- No
apt, apk, yum
- Root filesystem is read-only
- You’re not meant to modify the base OS
Best way (recommended): use a Docker container
Run a temporary container that has diff available:
docker run --rm -it \
-v /DATA:/DATA \
alpine sh
Inside the container:
apk add diffutils
diff -r /DATA/path1 /DATA/path2
That runs locally on the disk, not over network > fast.
Alternative (even simpler)
Use a full Ubuntu container:
docker run --rm -it \
-v /DATA:/DATA \
ubuntu bash
Then:
apt update
apt install -y diffutils
diff -r /DATA/path1 /DATA/path2
Why this is the correct approach
- Keeps ZimaOS clean (no breaking the system)
- Uses Docker (native to ZimaOS design)
- Full Linux tooling available when needed
- Works on any path under
/DATA (your actual storage)
About doing it over SSH
You’re right:
- Running
diff remotely over SSH = slower (network overhead)
- Running inside a container on the ZimaBlade = direct disk access > much faster
2 Likes
Thank you for such a great explanation, this is exactly what I needed.