📦 Persistent Package Installation
MOS is designed to run from a compressed, read-only root filesystem (rootfs). Any changes made to the system via apt install or similar commands will be lost after a reboot, as the root filesystem is rebuilt from the compressed image on every startup.
To install additional packages that persist across reboots, MOS provides a dedicated directory for optional Debian packages.
📂 Package Directory
Place your .deb packages in the following directory:
/boot/optional/packages
Packages placed here will be automatically installed during system startup before services are started.
- Only
.debpackages are supported - Packages must be compatible with the MOS base system (Devuan Linux)
- Dependencies are not automatically resolved — ensure all required dependencies are either pre-installed on MOS or also placed in this directory
🔧 How to Add Packages
Step 1: Download the Package
Use apt download to obtain a .deb package without installing it:
apt download <package-name>
This will download the .deb file to the current directory.
Example:
apt download htop
This creates a file like htop_3.2.2-2_amd64.deb in the current directory.
If the package has dependencies that are not already present on MOS, download them as well:
apt download <package-name> && apt download <dependency1> <dependency2>
Step 2: Copy to /boot/optional/packages
Move or copy the downloaded .deb file(s) to the persistent package directory:
cp *.deb /boot/optional/packages/
- Do not extract or modify the
.debfiles - Place only valid
.debpackages in this directory - The
/bootpartition must have sufficient free space
Step 3: Reboot
After placing the packages in the directory, reboot the system:
reboot
During startup, MOS will automatically install all .deb packages found in /boot/optional/packages.
❌ What Does NOT Work
Running apt install directly will install the package into the running root filesystem, but these changes will be lost on the next reboot:
# This will NOT persist after reboot!
apt install htop
This is because MOS reconstructs the root filesystem from the compressed base image on every boot. Only packages in /boot/optional/packages are reinstalled automatically.
✅ Best Practices
| Do | Don't |
|---|---|
Use apt download to obtain .deb files | Use apt install for persistent installations |
Place .deb files in /boot/optional/packages | Modify the running root filesystem expecting persistence |
| Verify package compatibility with MOS | Install packages with complex dependency trees without checking |
| Reboot after adding packages | Expect immediate availability without reboot |
⚠️ Limitations
- No automatic dependency resolution — you must ensure all dependencies are available
- Only
.debformat is supported (no.rpm, source builds, or other package formats) - No package manager tracking — packages installed this way are not tracked by
dpkgin the running system; they are reinstalled on every boot
✅ Summary
- Persistent packages go to
/boot/optional/packages - Use
apt downloadto fetch.debfiles - Reboot to apply installations
- Direct
apt installdoes not persist
For system packages that must survive reboots, always use /boot/optional/packages.
Parts of this documentation were created with the assistance of AI tools. All AI-generated content has undergone review, but it may still contain inaccuracies, omissions, or outdated information.