Keep your Distrobox containers automatically updated on any Linux system that uses Systemd.
- 🟢 Automatic updates for all Distrobox containers
 - 🟢 Flexible scheduling weekly or daily
 - 🟢 No sudo needed run as normal user
 
- systemd the host system must have systemd by default
 - Podman or Docker on the host system (Linux)
 - Distrobox with container installed (see how to install)
 
This script works regardless of whether Distrobox is installed in the user folder or the root folder. However, container managers like DistroShelf or BoxBuddy only recognize Distrobox installed in the root folder.
The script will automatically create files in ~/.config/systemd/user/ and configure automatic updates according to your choice!
cd ~/Downloads
wget https://raw.githubusercontent.com/diogopessoa/distrobox-container-auto-upgrade/main/distrobox-container-auto-upgrade.shchmod +x distrobox-container-auto-upgrade.sh./distrobox-container-auto-upgrade.shSelect the update type:
1. Weekly Update (Mnday 10:00)
2. Daily Update (60s after boot)
Enter your choice (1 or 2): 
First, locate your Distrobox executable path:
which distrobox-upgrade || find / -name "distrobox-upgrade" 2>/dev/nullCreate the service file:
mkdir -p ~/.config/systemd/user
nano ~/.config/systemd/user/distrobox-upgrade.servicePaste this content (adjust the path if needed):
[Unit]
Description=Update all Distrobox containers
After=network-online.target
[Service]
Type=oneshot
ExecStart=/usr/sbin/distrobox-upgrade --all
# Optional: Desktop notification (requires GUI)
ExecStartPost=/usr/bin/notify-send "📦️ Distrobox" "Containers updated successfully!"nano ~/.config/systemd/user/distrobox-upgrade.timer[Unit]
Description=Update Distrobox containers (weekly, Monday 10h)
[Timer]
# Execute every Monday at 10h
OnCalendar=Mon 10:00:00
# Tolerance for execution
AccuracySec=1h
# Run if missed last window
Persistent=true
[Install]
WantedBy=timers.targetnano ~/.config/systemd/user/distrobox-upgrade.timer[Unit]
Description=Update Distrobox containers (60s after boot)
[Timer]
# Runs 60 seconds after each system boot
OnBootSec=60s
# Execution window
AccuracySec=1h
# Run if missed last window
Persistent=true
[Install]
WantedBy=timers.target# Reload user services
systemctl --user daemon-reload
# Enable and start the timer
systemctl --user enable --now distrobox-upgrade.timer
# Verify the schedule
systemctl --user list-timers --allExpected output:
NEXT                        LEFT          LAST                        PASSED       UNIT                         ACTIVATES
Mon 2025-08-22 10:00:00 -03 6 days       Mon 2025-08-11 10:00:00 -03 1h 12min ago distrobox-upgrade.timer      distrobox-upgrade.service
systemctl --user start distrobox-upgrade.serviceMIT
