← Back to list

Fix Broken Arch Linux: Corrupted Shared Libraries After Failed pacman -Syu Update

When pacman can’t run because its own libraries are broken

Stoic_Gang · 2026-04-13 14:29 · 0 claps · 1.4 min read
#arch-linux #pacman #broken-packages #linux-recovery #virtualbox
Open on Medium ↗
Wiki topics: 🔓 · Open Source

Fix Broken Arch Linux: Corrupted Shared Libraries After Failed pacman -Syu Update

When pacman can’t run because its own libraries are broken

The Problem

Interrupted *pacman -Syu* = shared libraries written as empty/truncated files. Now nothing works; not pacman, not bash, not even init.

You’ll see errors like:

/sbin/init: error while loading shared libraries: /usr/lib/libcrypto.so.3: file too short
pacman: error while loading shared libraries: libarchive.so.13: cannot open shared object file
bash: error while loading shared libraries: libreadline.so.8: cannot open shared object file

If you’re on VirtualBox and see VERR_DISK_FULL.That’s your host machine out of space, not the VM. Free space on the host first.

Why The Usual Fixes Don’t Work

  • pacman -Syyu→ pacman can’t start, its libraries are broken
  • Delete db.lck → not a lock problem
  • pacman -Scc → same, pacman can’t run

Fix one package at a time → fixes one .so, next one is missing, infinite loop

The Fix

1. Boot Arch ISO: VirtualBox → F12 → CD-ROM

2. Mount

mount /dev/sda2 /mnt
mount /dev/sda1 /mnt/boot

3. Reinstall everything from outside

This is the key command:

pacman -r /mnt — cachedir /mnt/var/cache/pacman/pkg -S $(pacman -r /mnt -Qq) — overwrite ‘*’ — noconfirm

Uses the ISO’s working pacman to reinstall every package into your broken system. No chroot needed. No dependency loops.

4. Verify: arch-chroot /mnt pacman — version

Should print a version number. Then:

arch-chroot /mnt pacman -Syu
arch-chroot /mnt pacman -Qk 2>&1 | grep -v “0 missing”

No output from the second command = clean system.

5. Rebuild boot

arch-chroot /mnt mkinitcpio -P
arch-chroot /mnt grub-install /dev/sda
arch-chroot /mnt grub-mkconfig -o /boot/grub/grub.cfg

6. Reboot

exit
umount -l /mnt
reboot

Password Won’t Work After Reboot?

The -overwriteflag wipes /etc/shadow. Boot ISO again:

arch-chroot /mnt
passwd
useradd -d /home/USERNAME -G wheel -s /bin/bash USERNAME
passwd USERNAME
EDITOR=nano visudo → uncomment %wheel ALL=(ALL:ALL) ALL

Use -d not -m — home directory already exists.

Prevention

  • Don’t interrupt pacman -Syu
  • Check the host disk space before VM work
  • Take VM snapshots before upgrades

**Full guide with all edge cases**

If this saved you a few hours of chasing missing .so files, it did its job. Take that snapshot next time.


메타데이터
post_id
f3d42ec82ac0
slug
fix-broken-arch-linux-corrupted-shared-libraries-after-failed-pacman-syu-update-f3d42ec82ac0
url
https://medium.com/@stoicgaster0.07/fix-broken-arch-linux-corrupted-shared-libraries-after-failed-pacman-syu-update-f3d42ec82ac0
canonical_url
https://medium.com/@stoicgaster0.07/fix-broken-arch-linux-corrupted-shared-libraries-after-failed-pacman-syu-update-f3d42ec82ac0
author_url
https://medium.com/@stoicgaster0.07
status
ok
fetched_at
2026-07-13 06:23:13