# ๐Ÿ“š **apt-ostree Command Reference** ## ๐ŸŽฏ **Overview** This document provides a complete reference for all apt-ostree CLI commands, organized by functionality and including examples, flags, and usage patterns. All commands maintain 100% compatibility with rpm-ostree. ## ๐Ÿ”ง **Global Options** All commands support these global options: ```bash -h, --help Show help message -V, --version Show version information -q, --quiet Suppress output -v, --verbose Verbose output --debug Enable debug output ``` ## ๐Ÿ“Š **System Status Commands** ### **`status`** - Show System Status Display current system status including OSTree deployments and package information. ```bash # Basic status apt-ostree status # Status for specific OS apt-ostree status --os debian # JSON output apt-ostree status --json # Verbose output apt-ostree status --verbose ``` **Options:** - `-o, --os ` - Operating system name - `-j, --json` - Output in JSON format - `-v, --verbose` - Verbose output ### **`db`** - Database Operations Query and manage the package database. ```bash # List packages apt-ostree db list # Show package differences apt-ostree db diff # Show database version apt-ostree db version ``` **Subcommands:** - `list` - List packages in database - `diff` - Show differences between deployments - `version` - Show database version information ## ๐Ÿš€ **System Management Commands** ### **`upgrade`** - Upgrade System Perform a system upgrade to the latest available version. ```bash # Basic upgrade apt-ostree upgrade # Upgrade with reboot apt-ostree upgrade --reboot # Upgrade specific OS apt-ostree upgrade --os debian # Preview upgrade apt-ostree upgrade --preview ``` **Options:** - `-o, --os ` - Operating system name - `-r, --reboot` - Reboot after upgrade - `--preview` - Preview changes without applying - `-y, --yes` - Answer yes to prompts ### **`deploy`** - Deploy Specific Commit Deploy a specific OSTree commit. ```bash # Deploy specific commit apt-ostree deploy # Deploy with reboot apt-ostree deploy --reboot # Deploy with options apt-ostree deploy --os debian --reboot ``` **Options:** - `-o, --os ` - Operating system name - `-r, --reboot` - Reboot after deployment - `--preview` - Preview deployment without applying ### **`rollback`** - Rollback to Previous Deployment Revert to the previously booted deployment. ```bash # Basic rollback apt-ostree rollback # Rollback with reboot apt-ostree rollback --reboot # Rollback specific OS apt-ostree rollback --os debian ``` **Options:** - `-o, --os ` - Operating system name - `-r, --reboot` - Reboot after rollback ## ๐Ÿ“ฆ **Package Management Commands** ### **`install`** - Install Packages Install additional packages into the current deployment. ```bash # Install single package apt-ostree install vim # Install multiple packages apt-ostree install vim emacs nano # Install with reboot apt-ostree install vim --reboot # Install specific version apt-ostree install vim=2:9.0.1378-1 ``` **Options:** - `-o, --os ` - Operating system name - `-r, --reboot` - Reboot after installation - `-y, --yes` - Answer yes to prompts ### **`uninstall`** - Remove Packages Remove previously installed packages. ```bash # Remove single package apt-ostree uninstall vim # Remove multiple packages apt-ostree uninstall vim emacs # Remove with reboot apt-ostree uninstall vim --reboot ``` **Options:** - `-o, --os ` - Operating system name - `-r, --reboot` - Reboot after removal - `-y, --yes` - Answer yes to prompts ### **`override`** - Package Overrides Manage base package overrides. ```bash # Replace package apt-ostree override replace vim 2:9.0.1378-1 # Reset package override apt-ostree override reset vim # List overrides apt-ostree override list ``` **Subcommands:** - `replace ` - Replace base package with different version - `reset ` - Reset package to base version - `list` - List current package overrides **Options:** - `-o, --os ` - Operating system name - `-r, --reboot` - Reboot after override - `--lock-finalization` - Lock finalization ## ๐Ÿ”„ **Advanced System Commands** ### **`usroverlay`** - User Overlays Apply transient overlayfs modifications to /usr. ```bash # Apply overlay apt-ostree usroverlay apply my-overlay /path/to/source /usr/local/custom # List overlays apt-ostree usroverlay list # Reset overlay apt-ostree usroverlay reset my-overlay # Remove overlay apt-ostree usroverlay remove my-overlay ``` **Subcommands:** - `apply ` - Apply user overlay - `list` - List current user overlays - `reset ` - Reset overlay to base state - `remove ` - Remove user overlay **Options:** - `-o, --os ` - Operating system name - `--read-only` - Make overlay read-only - `--allow-other` - Allow other users to access - `--default-permissions` - Use default permissions ### **`apply-live`** - Live Updates Apply changes to the running system without rebooting. ```bash # Apply live update apt-ostree apply-live apply # Show live update status apt-ostree apply-live status # Rollback live update apt-ostree apply-live rollback ``` **Subcommands:** - `apply ` - Apply live update to deployment - `status` - Show live update status - `rollback ` - Rollback live update **Options:** - `-o, --os ` - Operating system name - `-r, --reboot` - Reboot after live update - `--lock-finalization` - Lock finalization ### **`compose`** - Tree Composition Compose and manage OSTree trees. ```bash # Compose tree apt-ostree compose tree treefile.yml # Install packages in tree apt-ostree compose install treefile.yml vim emacs # Post-process tree apt-ostree compose postprocess treefile.yml # Commit tree apt-ostree compose commit treefile.yml ``` **Subcommands:** - `tree ` - Compose tree from treefile - `install ` - Install packages in tree - `postprocess ` - Post-process composed tree - `commit ` - Commit composed tree **Options:** - `-o, --os ` - Operating system name - `--output-dir ` - Output directory for artifacts ## ๐Ÿ”ง **System Configuration Commands** ### **`initramfs`** - Initramfs Management Manage initramfs generation and configuration. ```bash # Regenerate initramfs apt-ostree initramfs regenerate # Enable initramfs apt-ostree initramfs enable # Disable initramfs apt-ostree initramfs disable ``` **Subcommands:** - `regenerate` - Regenerate initramfs - `enable` - Enable initramfs generation - `disable` - Disable initramfs generation **Options:** - `-o, --os ` - Operating system name ### **`kargs`** - Kernel Arguments Query and modify kernel command-line arguments. ```bash # Get kernel arguments apt-ostree kargs get # Set kernel arguments apt-ostree kargs set console=ttyS0 # Delete kernel arguments apt-ostree kargs delete console # Reset kernel arguments apt-ostree kargs reset ``` **Subcommands:** - `get` - Get current kernel arguments - `set ` - Set kernel arguments - `delete ` - Delete kernel arguments - `reset` - Reset to default kernel arguments **Options:** - `-o, --os ` - Operating system name - `-r, --reboot` - Reboot after changes ### **`rebase`** - Rebase to Different Base Switch to a different base tree. ```bash # Rebase to different base apt-ostree rebase # Rebase with reboot apt-ostree rebase --reboot # Preview rebase apt-ostree rebase --preview ``` **Options:** - `-o, --os ` - Operating system name - `-r, --reboot` - Reboot after rebase - `--preview` - Preview changes without applying ## ๐Ÿงน **System Maintenance Commands** ### **`cleanup`** - Clean Up System Clear cached and pending data. ```bash # Basic cleanup apt-ostree cleanup # Clean specific items apt-ostree cleanup --pending --cache # Force cleanup apt-ostree cleanup --force ``` **Options:** - `--pending` - Clean pending deployments - `--cache` - Clean package cache - `--force` - Force cleanup operations ### **`refresh-md`** - Refresh Metadata Refresh package repository metadata. ```bash # Refresh metadata apt-ostree refresh-md # Refresh specific repository apt-ostree refresh-md --repo ``` **Options:** - `--repo ` - Specific repository to refresh ### **`reload`** - Reload Configuration Reload system configuration. ```bash # Reload configuration apt-ostree reload # Reload specific components apt-ostree reload --daemon --config ``` **Options:** - `--daemon` - Reload daemon configuration - `--config` - Reload system configuration ### **`reset`** - Reset System State Reset system to clean state. ```bash # Reset system apt-ostree reset # Reset with reboot apt-ostree reset --reboot # Reset specific components apt-ostree reset --packages --overrides ``` **Options:** - `-r, --reboot` - Reboot after reset - `--packages` - Reset package installations - `--overrides` - Reset package overrides ## ๐Ÿณ **Container and Image Commands** ### **`container`** - Container Operations Manage container images and operations. ```bash # List containers apt-ostree container list # Pull container apt-ostree container pull # Push container apt-ostree container push ``` **Subcommands:** - `list` - List available containers - `pull ` - Pull container image - `push ` - Push container image ### **`image`** - Image Operations Manage system images. ```bash # Build image apt-ostree image build # Export image apt-ostree image export # Import image apt-ostree image import ``` **Subcommands:** - `build ` - Build system image - `export ` - Export image in format - `import ` - Import image from file ## ๐Ÿ”Œ **Remote Management Commands** ### **`remote`** - Remote Management Manage remote repositories and sources. ```bash # List remotes apt-ostree remote list # Add remote apt-ostree remote add # Remove remote apt-ostree remote remove # Show remote info apt-ostree remote show ``` **Subcommands:** - `list` - List configured remotes - `add ` - Add new remote - `remove ` - Remove remote - `show ` - Show remote information ## ๐ŸŽฎ **Daemon Control Commands** ### **`start-daemon`** - Start Daemon Start the apt-ostree daemon. ```bash # Start daemon apt-ostree start-daemon # Start with options apt-ostree start-daemon --foreground --debug ``` **Options:** - `--foreground` - Run in foreground - `--debug` - Enable debug mode ### **`stop-daemon`** - Stop Daemon Stop the apt-ostree daemon. ```bash # Stop daemon apt-ostree stop-daemon # Force stop apt-ostree stop-daemon --force ``` **Options:** - `--force` - Force stop daemon ## ๐Ÿ“‹ **Command Categories Summary** | Category | Commands | Description | |----------|----------|-------------| | **Status** | `status`, `db` | System information and database queries | | **Management** | `upgrade`, `deploy`, `rollback` | System deployment and updates | | **Packages** | `install`, `uninstall`, `override` | Package management and overrides | | **Advanced** | `usroverlay`, `apply-live`, `compose` | Advanced system features | | **Configuration** | `initramfs`, `kargs`, `rebase` | System configuration | | **Maintenance** | `cleanup`, `refresh-md`, `reload`, `reset` | System maintenance | | **Containers** | `container`, `image` | Container and image management | | **Remotes** | `remote` | Remote repository management | | **Daemon** | `start-daemon`, `stop-daemon` | Daemon control | ## ๐Ÿ” **Finding Commands** ### **By Functionality** - **Package Management**: `install`, `uninstall`, `override` - **System Updates**: `upgrade`, `deploy`, `rollback` - **Configuration**: `initramfs`, `kargs`, `rebase` - **Advanced Features**: `usroverlay`, `apply-live`, `compose` ### **By Privilege Level** - **Local Commands**: `status`, `db`, `pkg` (no root required) - **Root Commands**: Most commands require root privileges - **Daemon Commands**: `start-daemon`, `stop-daemon` ### **By System Impact** - **Read-Only**: `status`, `db`, `list` commands - **System Changes**: `install`, `upgrade`, `deploy` - **Configuration**: `kargs`, `initramfs`, `rebase` ## ๐Ÿ“– **Getting Help** ### **Command Help** ```bash # General help apt-ostree --help # Command help apt-ostree --help # Subcommand help apt-ostree --help ``` ### **Examples** ```bash # Show examples for command apt-ostree --help | grep -A 10 "EXAMPLES" # Run with verbose output apt-ostree --verbose ``` --- *This command reference provides comprehensive coverage of all apt-ostree CLI commands. For detailed implementation information, refer to the architecture documents in the `docs/apt-ostree-daemon-plan/architecture/` directory.*