Simple utility to enable or disable apt package management on TrueNAS when you require it.
Usage: ./truenas-modify COMMAND
Expects you can provide sudo password when asked.
Commands:
apt-enable Enable apt package management by making /usr writable
apt-disable Disable apt package management by making /usr read-only
mount-rw Mount a system directory read-write
mount-ro Mount a system directory read-only
--help Show this help message
# install a package manually
./truenas-modify apt-enable
sudo apt update
sudo apt install package-name
./truenas-modify apt-disable
# copy a binary to a space that is not /tmp, since /tmp is mounted as noexec
./truenas-modify mount-rw /opt
cp ~/downloads/app-v1.0.tar/app /opt/app
chmod +x /opt/app
./truenas-modify mount-ro /opt
/opt/app
apt-enable
:
- Remount /usr as read-write
- Add executability to /bin/apt* and /usr/bin/dpkg
- Remount /usr as read-only
apt-disable
:
- Remount /usr as read-write
- Remove executability from /bin/apt* and /usr/bin/dpkg
- Remount /usr as read-only
- It does not modify PATH
- It does not execute any apt commands, update the apt repository list, add repositories, nor update any packages