rb-update
Overview
rb-update is a utility script that automates RecoveryBox updates by checking the latest version available on GitHub, downloading it, and re-running the installation script.
It is deployed by Ansible to /usr/local/bin/rb-update.sh.
Root execution required
The script must be run as root (sudo rb-update.sh). It does not explicitly check UID but apt, git, and the RecoveryBox_install.sh call all require root privileges.
Reboot may be required
Depending on applied updates (kernel, systemd-networkd, Docker, etc.), a reboot may be necessary after the update completes.
Execution Modes
| Mode | Command | Description |
|---|---|---|
| Major update (default) | sudo rb-update.sh |
Checks latest GitHub release (latest tag) |
| Minor update | sudo rb-update.sh --minor |
Checks latest 1.x branch tag. Gets latest patches |
| Full system + RB update | sudo rb-update.sh --full |
Updates Debian packages (apt upgrade) then RecoveryBox |
| Minor + full | sudo rb-update.sh --minor --full |
Combines --minor and --full |
Note
Options --minor and --full are cumulative and can be combined in any order.
Usage Guide
Standard Update (Major Version)
sudo rb-update.sh
- Reads current version from
/etc/recoverybox/rb_version - Queries GitHub API for latest
latestrelease tag - If a newer version is available, prompts for confirmation (
Y/N) - Downloads source code (git fetch/reset/checkout or clone if missing)
- Runs
RecoveryBox_install.sh(interactive orcustommode depending on/etc/recoverybox/custom_config.ymlpresence)
Minor Update (1.x Patch Releases)
sudo rb-update.sh --minor
Same as standard mode but targets the latest 1.x tag instead of latest. Useful for staying on a stable branch.
Full Update (System + RecoveryBox)
sudo rb-update.sh --full
Adds an apt-get update && apt-get upgrade -y step before the RecoveryBox update. Recommended to apply Debian security patches.
Detailed Workflow
1. Version Check (Check_Update)
- Reads
/etc/recoverybox/rb_version(installed version) - GitHub API request:
majormode (default):GET /repos/mr-dgidgi/recoverybox/releases/latestminormode:GET /repos/mr-dgidgi/recoverybox/tags→ filters latest1.tag- Compares versions (string comparison)
- Displays current and available versions
2. Download (Download_Update)
- Target directory:
/root/RecoveryBox - If directory exists:
git fetch --all && git reset --hard && git checkout <tag> - Otherwise:
git clone --depth 1 --branch <tag> https://github.com/mr-dgidgi/recoverybox.git /root/RecoveryBox
3. Optional System Update (Update_System)
- If
--full:apt-get update -y && apt-get upgrade -y - Exits on
aptfailure
4. Apply Update (Update_RecoveryBox)
- Executes
bash /root/RecoveryBox/RecoveryBox_install.sh - Install script detects existing
/etc/recoverybox/rb_versionand appends-upgradingsuffix - Re-runs Ansible playbook with existing or interactive configuration
Common Troubleshooting
| Symptom | Probable Cause | Resolution |
|---|---|---|
Current Recovery Box version: 0.0.0 |
rb_version file missing or empty |
Reinstall or create file manually |
curl returns empty / timeout |
No Internet / GitHub API blocked | Check connectivity, DNS, firewall |
git checkout fails |
Tag doesn't exist / repo corrupted | Remove /root/RecoveryBox and re-run |
apt-get upgrade fails (--full) |
Package conflict / dpkg lock | dpkg --configure -a && apt --fix-broken install then retry |
RecoveryBox_install.sh not found |
Failed clone / wrong tag | Check /root/RecoveryBox, delete and retry |
| Script says no update available | Already at latest version | Normal behavior, nothing to do |
| Ansible playbook fails | Docker, network, config error | See Debug or RecoveryBox_install.sh documentation |
Related Files
| File | Purpose |
|---|---|
/usr/local/bin/rb-update.sh |
Main script (managed by Ansible) |
/etc/recoverybox/rb_version |
Installed version (written by RecoveryBox_install.sh) |
/etc/recoverybox/custom_config.yml |
User config (re-applied on update) |
/root/RecoveryBox/ |
Git clone of repository (update source) |