Advanced use

Deploy package layering

Warning

Mirantis recommends that package layering be used only for debugging specific deployments, and not to manage system state at scale.

With package layering, you can create an overlay deployment with the rpm-ostree ex command and install packages into that overlay. Subsequently, this allows you to install additional packages on top of the base operating system image without modifying the codebase itself, thus permitting you to test new customizations and experimental changes against the booted deployment without risk.

Note

For example purposes, the procedure detailed herein will install the telnet package.

  1. Install the package.

    rpm-ostree install telnet
    

    Example system response:

    Checking out tree 0572d28... done
    ...<OUTPUT TRUNCATED>...
    Staging deployment... done
    Added:
      telnet-1:0.17-76.el8.x86_64
    Changes queued for next boot. Run "systemctl reboot" to start a reboot
    
  2. Boot the package.

    telnet
    

    Example system response:

    -bash: telnet: command not found
    
  3. Create a transient overlayfs filesystem for the booted /usr, and synchronize the changes from the source to the booted filesystem tree:

    rpm-ostree ex apply-live
    

    Example system response:

    NOTICE: Experimental commands are subject to change.
    Computing /etc diff to preserve... done
    Updating /usr... done
    Updating /etc... done
    Running systemd-tmpfiles for /run and /var... done
    Added:
      telnet-1:0.17-76.el8.x86_64
    Successfully updated running filesystem tree.
    

Manage system rollbacks

One of the key advantages of rpm-ostree is its ability to perform rollbacks to previous system states. Thus, whenever you encounter issues or unexpected behavior, you can invoke the rpm-ostree rollback command to revert the system to a known, stable deployment.

rpm-ostree rollback

To effectively manage rollbacks, Mirantis recommends that you maintain multiple deployments, each with a different version or configuration. Using this approach, you can switch between deployments and perform rollbacks as necessary.