Power cut to desktop during upgrade using zypper

While running zypper to upgrade one of my desktops, the power was unexpectedly cut to the desktop in the middle of the package upgrades and it powered off. I discovered the plug going into the desktop’s power supply had somehow become loose.

After reconnecting the plug, I powered the desktop back on and re-ran zypper to resume the process. The remaining packages were all shown as being in the queue and zypper reported no errors when the process completed.

Is there a command that could be run which would show which package upgrade may have been interrupted at the time the desktop lost power?

Myrlyn lists packages upgraded and removed by date and when I scrolled through the list (over 700 packages), it did not indicate any errors.

Otherwise, the desktop boots up fine and works perfectly, Xfce and KDE are the installed desktops and both were checked.

Thank you in advance.

You can perform a sudo zypper verify, but as you already noticed yourself, when zypper dup finishes without error, there is nothing to worry.

You can perform a filesystem check to rule out any damages when the power went off.

sudo zypper verify indicated all dependencies satisfied.

The file system check (run from install media / Rescue System) reported no errors.

All is well.

Thank you again.

Usually, zypper dup does all the downloads first, and when they are all finished, it starts installing the downloaded packages one by one. It looks like you got lucky, and the power failed during the download phase; no harm done, just restart the whole thing.

If this happens during the installation phase, you might get a system in an inconsistent state. But even then it’s only really critical if a new kernel was just installed, but the dracut run (creating the initrd) which is done in the post-install script didn’t finish. In the worst case, you might have to boot the previous kernel, log into a text console and finish the aborted zypper dup from there.

2 Likes

The power cut out in the middle of installing the new packages. The new packages included a new kernel (6.18.1) and when I powered it back on, the new kernel was listed in GRUB. I opted to boot into the previous kernel’s recovery mode to see if it would boot up (it did). The aborted zypper dup was performed via that prior kernel.

To run dracut for the new kernel, I booted into it, then ran dracut --force. No errors reported and it rebooted successfully into the same kernel.

To avoid this kind of risk and protect your computer, you should invest in an uninterruptible power supply (UPS).
You can find good ones at reasonable prices on the likes of Amazon.

A UPS would not have helped in this case, as the power became disconnected from the desktop’s power supply directly, not from the AC.

I got my dead UPS fitted with a new battery to avoid this kind of situation. Otherwise for every update, i used to pray to god for no interruption of power in next 5 minutes. :grinning:

This topic was automatically closed 7 days after the last reply. New replies are no longer allowed.