You are not logged in.

#1 2025-06-17 01:12:01

jecogeo
Member
Registered: 2019-05-27
Posts: 29

Broken Arch install after interrupted update – pacman unusable

I'm trying to recover a broken Arch Linux system after a power outage interrupted a full system update.

Summary of the situation

The update was interrupted during the installation phase (after all packages were downloaded).
On reboot, the system do not load, pacman is broken, and no internet is available.
Booted into a Live USB and mounted the system at /mnt.

System environment

- /mnt has the main root system.
- /mnt/var/cache/pacman/pkg contains a complete set of .pkg.tar.zst files from the failed update (hundreds of packages).
- Internet works fine from the Live USB.
- Inside chroot:
   - ping any IP fails
   - ping any address (e.g. archlinux.org) fails
- pacman

So, not just DNS — no internet at all inside chroot.
Basic tools (systemctl, pacman, etc.) fail due to partial updates.

Steps tried so far

1. Full chroot setup

mount /dev/root /mnt
mount /dev/boot /mnt/boot
cp /etc/resolv.conf /mnt/etc/resolv.conf
arch-chroot /mnt

Still, no internet in chroot — not even raw IPs.

2. Offline package reinstall from Live USB

From the Live USB, tried reinstalling all cached packages into the mounted system using:

pacman -U --root /mnt/ --overwrite '*' --noconfirm /mnt/var/cache/pacman/pkg/*.pkg.tar.zst

This partially worked:
- Most packages were successfully reinstalled
- Some packages failed with:

invalid or corrupted package (PGP signature)

Even after installing archlinux-keyring from cache, this issue persisted with some packages.

Also tried adding SigLevel = Never to /mnt/etc/pacman.conf, but the PGP errors still happened in some cases, suggesting deeper corruption or inconsistency.


3. Attempted direct install inside chroot

arch-chroot /mnt
pacman -U /var/cache/pacman/pkg/package.pkg.tar.zst

This command ran silently with no output, no effect, no logs (even with --log-level=debug), and did not install anything.

Also ensured:

- db.lck was removed
- pacman database was writable
- Filesystem had plenty of space

Still, pacman does not work inside chroot.

Current state

- pacman is usable only from the Live USB, not in the chroot.
- Most packages from the cache were reinstalled, except a few with PGP issues.
- The chroot environment has no networking, so no way to fetch keys or packages.
- System likely has inconsistent package states, especially with core packages (systemd, glibc, pacman, etc.).

What I need help with

- How to fully reinstall all cached packages using pacman -U from Live USB while completely disabling PGP checks.
- How to restore networking (preferably minimal DHCP or static IP + DNS) inside the chroot for recovery.
- How to verify and repair system consistency without needing to wipe and reinstall.
- Is there a way to force-rebuild the system's package database to match the reinstalled .zst files?

Thanks in advance for any insight! I’m willing to go deep into manual recovery steps to avoid a reinstall.

Offline

#2 2025-06-17 05:17:42

jl2
Member
From: 47° 18' N 8° 34' E
Registered: 2022-06-01
Posts: 767

Re: Broken Arch install after interrupted update – pacman unusable

while completely disabling PGP checks.

You should hear yourself. if the package is corrupted (which pacman is telling you it is), then installing it will result in a corrupted system.

- How to restore networking (preferably minimal DHCP or static IP + DNS) inside the chroot for recovery.

Connecting to the internet is done outside the chroot, so that shouldn't be a problem. See https://wiki.archlinux.org/title/Instal … e_internet for details.

Then make a list of corrupted packages with 'pacman -Qkkq | awk '{print $1}' >pkgs.txt
Next try to reinstall/force overwrite all packages: 'pacman -S --root /mnt/ --overwrite '*' --cachedir /mnt/var/cache/pacman/pkg $(cat pkgs.txt)'
^ this one should ask you to delete corrupted package files, IIRC. you might need to run it twice.

Edit: Don't forget to update the pacman keyring again in the live usb, if you rebooted!

Last edited by jl2 (2025-06-17 06:02:59)


Why I run Arch? To "BTW I run Arch" the guy one grade younger.
And to let my siblings and cousins laugh at Arsch Linux...

Upload longer text output like this

Offline

#3 2025-06-17 22:59:32

jecogeo
Member
Registered: 2019-05-27
Posts: 29

Re: Broken Arch install after interrupted update – pacman unusable

Ok. Following your advice I was able to partially recover the system. Now I can boot the system. However before entering into Gnome I receive:

[FAILED] Failed to start D-Bus System Message Bus.
[DEPEND] Dependency failed for Network Manager.
[DEPEND] Dependency failed for Network Manager Wait Online.
[FAILED] Failed to start D-Bus System Message Bus.
[FAILED] Failed to start D-Bus System Message Bus.
[FAILED] Failed to start D-Bus System Message Bus.
[FAILED] Failed to start D-Bus System Message Bus.
[FAILED] Failed to start D-Bus System Message Bus.
[FAILED] Failed to start Bluetooth service. 
[FAILED] Failed to start User Login Management.
[FAILED] Failed to start D-Bus System Message Bus.

And then I fall on tty. There, checking

systemctl status dbus-broker

I see it failed to start with

 Invalid XML in /usr/share/dbus-1/system.d/gdm.conf +1: no element found

. The file is empty. I know this file is from GDM package, but running

 pacman -Qo /usr/share/dbus-1/system.d/gdm.conf

returns

error: No package owns /usr/share/dbus-1/system.d/gdm.conf

. (Corruption of the pacman database??)

Trying to install GDM (or any other package, actually) returns several lines as these (typos from OCR):

Idconfig: File /usr/lib/libKF6AuthCore.so is empty, not checked. 
Idconfig: File /usr/lib/libeis.so is empty, not checked. 
Idconfig: File /usr/lib/libcurl-gnutls.so is empty, not checked. 
Idconfig: File /usr/lib/libngtcp2_crypto_ossl.so is empty, not checked. 
Idconfig: File /usr/lib/libgit2.so.1. is empty, not checked. 
Idconfig: File /usr/lib/libQt6WaylandCompositorPresentationTime.so is empty, not checked. 
Idconfig: File /usr/lib/libavcodec.so.58.134.100 is empty, not checked. 
Idconfig: File /usr/lib/libdruntime-ldc-debug-shared.so.111.0 is empty, not checked. 
Idconfig: File /usr/lib/libpgtypes.so.3.17 is empty, not checked. 
Idconfig: File /usr/lib/libmpi.so.40 is empty, not checked. 
Idconfig: File /usr/lib/libedataserverui-1.2.so.4.0.0 is empty, not checked. 
Idconfig: File /usr/lib/libOpenEXRUtil.so is empty, not checked. 
Idconfig: File /usr/lib/libebook-1.2.so.21.1.3 is empty, not checked. 
Idconfig: File /usr/lib/libedataserverui4-1.0.so is empty, not checked. 
Idconfig: File /usr/lib/libIlmThread-3_3.so.32.3.3.4 is empty, not checked. 
Idconfig: File /usr/lib/libcurl-gnutls.so.4.4.0 is empty, not checked. 
Idconfig: File /usr/lib/libkirigamiLayoutsPrivate.so.6.15.0 is empty, not checked. 
Idconfig: File /usr/lib/libndr-standard.so.0.0.1 is empty, not checked. 
Idconfig: File /usr/lib/libhdf5_f90cstub.so is empty, not checked. 
ldconfig: File susr/lib/liblldCommon.so.20.1 is empty, not checked. 
Idconfig: File /usr/lib/libOpenEXR-3_3.so.32.3.3.4 is empty, not checked. 
Idconfig: File rusr/lib/libkirigamiPlatform.so.6.15.0 is empty, not checked. 
Idconfig: File /usr/lib/libQt6WaylandCompositorXdgShell.so is empty, not checked. Idconfig: File /usr/lib/libgirepository-1.0.so is empty, not checked. 
Idconfig: File /usr/lib/libebackend-1.2.so.11 is empty, not checked. 
Idconfig: File /usr/11b/1ibKP6ConfigGui.so.6 is empty, not checked. 
lacontig: File /usr/lib/libOpenEXRUtil-3_3.so is empty, not checked. 
Idconfig: File susr/lib/1ibKP6KIDCore.so is empty, not checked. 
Idconfig: File /usr/lib/libsamba-policy.so is empty, not checked. 
Idconfig: File /usr/lib/libkirigamiPolyfill.so is empty, not checked. 
Idconfig: File /usr/lib/libmpi_usempi_ignore_tkr.so is empty, not checked. 
Idconfig: File /usr/lib/libhdf5_cpp.so.310.0.6 is empty, not checked. 
Idconfig: File /usr/lib/libgnome-desktop-3.so.20 is empty, not checked. 
Idconfig: File /usr/lib/libdcerpc-server.so.0 is empty, not checked. 
Idconfig: File /usr/lib/libaudevice.so.58.13.100 is empty, not checked. 
Idconfig: File /usr/lib/libKF6Wallet.so.6.15.0 is empty, not checked. 
Idconfig: File /usr/lib/libdruntime-1dc-debug-shared.so.111 is empty, not checked.
Idconfig: File /usr/1ib/1ibKP6WidgetsAddons.so.6.15.0 is empty, not checked. 
Idconfig: File /usr/lib/liboshmem.so is empty, not checked. 
Idconfig: File /usr/lib/11bKF6Codecs.so.6 is empty, not checked. 
Idconfig: File /usr/lib/libcurl-gnutls.so.3 is empty, not checked. 
Idconfig: File /usr/lib/libpgtypes.so is empty, not checked. 
1dconfig: File /usr/1ib/1ibKF6Seruice.so.6 is empty, not checked. 
Idconfig: File /usr/lib/libmutter-16,so.0 is empty, not checked. 
Idconfig: File /usr/lib/11bQt6WaylandClient.so.6.9.1 is empty, not checked. 
Idconfig: File /usr/1ib/libpathplan.so.4.0.0 is empty, not checked. 
Idconfig: File /usr/lib/libgnome-bluetooth-3,0,so.13 is empty, not checked. 
Idconfig: File /usr/lib/libgnome-rp-4,so.2.1.3 is empty, not checked. 
Idconfig: File /usr/lib/libdcerpc-server,so.0.0.1 is empty, not checked. 
Idconfig: File /usr/lib/liblex-3_3,so is empty, not checked. 
Idconfig: File /usr/1ib/11bKF6MalletBackend,so.6.15,0 is empty, not checked. 
Idconfig: File /usr/lib/1ibvala-0,56,so is empty, not checked. 
Idconfig: File /usr/1ib/11bKFGKIOGui,so,6 is empty, not checked. 
Idconfig: File /usr/lib/libKirigamiPolyf111,so.6 is empty, not checked. 
Idconfig: File /usr/lib/libkirigamiLayoutsPrivate.so is empty, not checked. 
Idconfig: File /usr/lib/libecpg.so is empty, not checked. 
Idconfig: File /usr/lib/1ibKF6Archive,so.6.15.0 is empty, not checked. 
Idconfig: File /usr/lib/libsamdb.so.0 is empty, not checked. 
Idconfig: File /usr/lib/libpg.so.5.17 is empty, not checked.
:: Running post-transaction hooks…
Etc

I have dozens of empty files on /usr/, compromising key processes. I’m avoiding reinstall the system from scratch as much as possible. So my approach would be:

find /usr -type f -empty 2>/dev/null | while read -r f; do
  pacman -Qo "$f" 2>/dev/null
done | awk '{print $5}' | sort -u > /tmp/pacotes-corrompidos.txt

To identify as many ownership of empty files as I can, identifying manually those not got by the script, and then reinstall them all.

Any thoughts? Do you think it could work? Any other tip?

Offline

#4 2025-06-18 04:59:48

jl2
Member
From: 47° 18' N 8° 34' E
Registered: 2022-06-01
Posts: 767

Re: Broken Arch install after interrupted update – pacman unusable

(typos from OCR)

That's very smart, gonna copy the idea wink
FYI you can also use a pastebin client.

To identify as many ownership of empty files as I can, identifying manually those not got by the script, and then reinstall them all.

This would have been the same as my approach, after looking up what to do if that error is encountered, greenlit by me big_smile

. (Corruption of the pacman database??)

IDK. What happens if you simply reinstall gdm?

At this point, though, it might be easier to just reinstall all the packages, since you only upgraded it should still contain the same pachages, no matter if the database is pre-corruption or mid-corruption. Up to you.
https://wiki.archlinux.org/title/Pacman … l_packages

Last edited by jl2 (2025-06-18 07:21:04)


Why I run Arch? To "BTW I run Arch" the guy one grade younger.
And to let my siblings and cousins laugh at Arsch Linux...

Upload longer text output like this

Offline

Board footer

Powered by FluxBB