It prevents your desktop from crashing and leaving your system unusable or unbootable. This especially applies to ext4 users who dislike or can’t use btrfs for some reason.
I was updating my system yesterday when the kde desktop suddenly crashed and restarted. The update seemed to be successful, but booting the 6.4.12 kernel was unsucessful. Thinking the kernel was broken, i rolled back, downloaded the updates using sudo zypper dup -d, then switched to a tty and did sudo zypper dup.
I’m probably living dangerously, I’ve been doing zypper dup in a konsole without taking any precautions and have never had an issue. This would be on tumbleweed for about 5 years, Leap/SUSE for decades (earlier it was always via yast).
I suppose one’s luck may depend on the hardware mix and whether you run any power management: I’ve only run desktops, no laptops, no power management/suspend, except for DPMS, and Nvidia for the at least the last couple of decades. I also don’t user btrfs or snapshots (but do keep backups based on rsync to online and offline storage).
But good advice, I should probably use tmux or screen, it’s not like it costs much effort. It’s never happened during a dup, but on quite rare occasions, X11 applications have locked up the mouse, so there’s that to consider.
systemd manages processes in distinct groups, a system slice and user slices. Duping in the user slice is a bad idea. Running it in the system slice is robust and unobtrusive. This service replaces PackageKit which is removed from Tumbleweed on infamous host erlangen and its numerous siblings:
erlangen:~ # systemctl list-timers dup
NEXT LEFT LAST PASSED UNIT ACTIVATES
Mon 2023-09-11 00:00:00 CEST 18h left Sun 2023-09-10 05:20:35 CEST 52min ago dup.timer dup.service
1 timers listed.
Pass --all to see loaded but inactive timers, too.
erlangen:~ #
At midnight erlangen was suspended to RAM. The persistent timer started today’s upgrade upon wake from sleep:
erlangen:~ # journalctl --since 0:00 -u dup.service -g 'Starting|following|conflicts|Consumed'
Sep 10 05:20:35 erlangen systemd[1]: Starting zypper dist-upgrade...
Sep 10 05:20:36 erlangen zypper[5310]: The following 56 packages are going to be upgraded:
Sep 10 05:20:36 erlangen zypper[5310]: The following product is going to be upgraded:
Sep 10 05:20:36 erlangen zypper[5310]: The following 3 NEW packages are going to be installed:
Sep 10 05:20:38 erlangen zypper[5310]: Checking for file conflicts: [.....done]
Sep 10 05:21:00 erlangen systemd[1]: dup.service: Consumed 20.849s CPU time.
erlangen:~ #