How do I recover a half-updated system?

The story is simple. I didn’t noticed that the laptop was not plugged, battery was too low, I triggered a dnf update and in the middle of it laptop shutdown.
I am pretty much sure downloads where completed and the shutdown happen in the middle of an update. Why, because I see that /lib64/libgcc_s.so is too short message when I tried dnf or lsblk. I suppose the library is completely broken at this stage.

To make things worse, the disk is LUKS encrypted but after power-on I don’t get any prompt, so I suppose it’s was not a complete power-cut but rather a suspend to disk.

My first thought was to install the libgcc RPM, but I have no clue which one I need to install.

Anyway, I would need some help to bring it back to life please.
swap is placed on a partition.

I would try a repair as follows.

  1. boot a f43 live system
  2. chroot into your existing fedora installation
  3. run sudo dnf distro-sync, or sudo dnf history redo last
  4. reboot

This will not help me, actually.
chroot will use the broken library.

I think the best I can do is to boot from a live 42 then copy the libgcc.
I mean it’s already broken :smiley:

1 Like

Yes, but you may try, assuming the system is mounted under /mnt/sysroot:

  • dnf --installroot=/mnt/sysroot reinstall libgcc
1 Like

That’s a good suggestion. Let’s try this

I don’t known if a live image honnors that, but you may try to add inst.rescue to the
GRUB linux parameters: this may mount properly the system under /mnt/sysroot

That didn’t work and it was expected of course. This is how I discovered that libgcc is broken.

I was talking about the GRUB entries of the live image.

Never mind. I guess that the live image provides a way to mount the system.
(I can’t verify that at the moment)

Try then to use dnf --installroot....

You can also verify all the packages of your system with: rpm -Va --root /mnt/sysroot

Re-installing libgcc fixed booting to the system. Then I completed the transaction and all good.
Thank you for pointing out the Live image, I have completely forgot about it!

1 Like

Good, but there is perhaps other corrupted files.

Use sudo rpm -Va to identify them, then reinstall the corresponding packages.

Use rpm -qf to identity the packages. Ex:

rpm -qf /lib64/libgcc_s.so.1 
libgcc-15.2.1-5.fc43.x86_64

1 Like