Create the update script, nothing fancy. Save it under $HOME/bin
. Make it executable.
#!/bin/bash
set -e
echo ================================================================
echo "Updating the TW box"
echo ================================================================
distrobox-enter tw2 -- sudo zypper ref
distrobox-enter tw2 -- sudo zypper dup -y
echo ================================================================
echo "Updating the Ubuntu box"
echo ================================================================
distrobox-enter ubuntu-box -- sudo apt update
distrobox-enter ubuntu-box -- sudo apt upgrade -y
echo ================================================================
echo "Updating the Fedora box"
echo ================================================================
distrobox-enter fedora-box -- sudo dnf upgrade -y
echo ================================================================
echo "Updating the Arch box"
echo ================================================================
Create the service: $HOME/.config/systemd/system/update-user-distrobox.service
[Unit]
Description=Update user distroboxes
[Service]
Type=oneshot
ExecStart=/home/apinter/bin/ddup
[Install]
WantedBy=default.target
Create the timer: $HOME/.config/systemd/system/update-user-distrobox.timer
[Unit]
Description=Update user distroboxes daily
[Timer]
OnCalendar=daily
Persistent=true
[Install]
WantedBy=timers.target
Enable timer: systemctl --user daemon-reload && systemctl --user enable --now update-user-distrobox.timer