Can't sudo, can't do a lot of things

hey guys,

so while i was sudo pacman -Syu my system, my area had a blackout and well now when I go back into my system. I can’t sudo anything

I can’t execute mpd to play music because it keeps saying /usr/lib/ file too short

I tried to do su root and install sudo or mpd or anything for that matter and it’s a dead end.
Any ideas how to fix this without doing a fresh reinstall of the whole system?

You can check the Arch Wiki for pacman there is a section there for crashes during an upgrade that may be applicable.


Thanks @PackRat
I am trying this pacman -Qnq | pacman -S right now. taking a bit of time.

Doesn’t work…gonna try something other stuff.

Read through the doc from @PackRat’s link and try these steps,

Pacman crashes during an upgrade

In the case that pacman crashes with a “database write” error while removing packages, and reinstalling or upgrading packages fails thereafter, do the following:

  1. Boot using the Arch installation media. Preferably use a recent media so that the pacman version matches/is newer than the system.
  2. Mount the system’s root filesystem, e.g., mount /dev/sdaX /mnt as root, and check the mount has sufficient space with df -h
  3. Mount the proc, sys and dev filesystems as well: mount -t proc proc /mnt/proc; mount --rbind /sys /mnt/sys; mount --rbind /dev /mnt/dev
  4. If the system uses default database and directory locations, you can now update the system’s pacman database and upgrade it via pacman --sysroot /mnt -Syu as root.
  1. After the upgrade, one way to double-check for not upgraded but still broken packages: find /mnt/usr/lib -size 0
  2. Followed by a re-install of any still broken package via pacman --sysroot /mnt -S package.

Hope it helps. Probably it’s time to take a look at timeshift now. :smiley:


Forgot to reply back on this. You can close the thread. I just ended up reinstalling the OS and actually happier now with my new setup even though it’s pretty much the same, but the little tweaks, colorschemes, and other tiny changes made it much better.