Error : file too short

Hello everyone.

I have a big problem this morning. My laptop freezed during an update.
I made a hard reboot with power button.

I think crash happened during the download sequence but seeing errors I’m not sure.

System boots but some apps won’t start and I can’t run Yay nor pacman.

[nicolas@arnold-gnome-nicolas ~]$ yay
yay: error while loading shared libraries: /usr/lib/libalpm.so.13: file too short
[nicolas@arnold-gnome-nicolas ~]$ sudo pacman -Syyu
[sudo] Mot de passe de nicolas : 
[nicolas@arnold-gnome-nicolas ~]$ gnome-terminal 
gnome-terminal: error while loading shared libraries: /usr/lib/libvte-2.91.so.0: file too short
[nicolas@arnold-gnome-nicolas ~]$ waybar -c ~/.config/waybar-sway/config -s ~/.config/waybar-sway/style.css
waybar: error while loading shared libraries: /usr/lib/libmpdclient.so.2: file too short

I run Kernel: 6.1.12-1-ck-generic-v3.

It’s the first time this happened to me and I absolutely don’t kown what to do. . . If I can find a solultion without reinstall it’s better!

Thx for help.

Try running another kernel (linux or linux-lts) and update.

If that doesn’t work, boot the liveISO installer and arch-chroot to your system.
More instructions by searching arch-chroot in our wiki.

looks not that good to me… you do had some system crash before or other issues?
check if these libs do exist at all:

ls -l /usr/lib/libalpm*

should show like this:

[11:53:13] joekamprad :: i3-private  ➜  ~ » ls -l /usr/lib/libalpm*
lrwxrwxrwx 1 root root     13 18. Mär 16:21 /usr/lib/libalpm.so -> libalpm.so.13
lrwxrwxrwx 1 root root     17 18. Mär 16:21 /usr/lib/libalpm.so.13 -> libalpm.so.13.0.2
-rwxr-xr-x 1 root root 247712 18. Mär 16:21 /usr/lib/libalpm.so.13.0.2
ldd /usr/bin/pacman

would check if it finds all needed libs…

and how is this:

installed? you do have any unofficial repositories in use?

Hello.
So I am on a live session and had chroot in my system.

Same errors

[root@EndeavourOS /]# yay
yay: error while loading shared libraries: /usr/lib/libalpm.so.13: file too short

and

[root@EndeavourOS /]# ls -l /usr/lib/libalpm*
lrwxrwxrwx 1 root root 13 Mar 18 16:21 /usr/lib/libalpm.so -> libalpm.so.13
lrwxrwxrwx 1 root root 17 Mar 18 16:21 /usr/lib/libalpm.so.13 -> libalpm.so.13.0.2
-rwxr-xr-x 1 root root  0 Mar 18 16:21 /usr/lib/libalpm.so.13.0.2

and

[root@EndeavourOS /]# ldd /usr/bin/pacman
	not a dynamic executable

I don’t remember how I installed ck kernel (don’t have time to search now) but it was an “official” (arch way?) way.

I had same issues with LTS kernel.

Looks bad. . .

Well.

I’m going to re-install -_-

Thank you for your help.

OK.
And a tip: if possible, be careful when installing AUR stuff. The recommendation is to prefer official packages over the AUR. It means avoid installing from AUR if a similar official package is available.
Doing this way can avoid some weird issues.

You could try (re)installing pacman from LiveISO, without chrooting (IIUC chroot would try using installed pacman/alpm, which is broken).

1 Like

https://wiki.archlinux.org/title/Unofficial_user_repositories/Repo-ck
should be fine its not some exotic stuff…

But we are only diggin in the dark here could been caused by something you have tried out before or a file corruption from a system crash or failed update… ?

And reinstalling pacman from teh livesession could be the trick to get pacman working again what would make you able to go reionstall system packages or all packages… to remove corruptions.
Mount your installed systems root under /mnt like you woiuld do for the arch-chrooting…
sudo pacman --sysroot /mnt -Syu pacman linux linux-headers

I couldn’t use Yay nor Pacman.

I reinstalled the system.

Yes. I always do that.

As joekamprad said I used the repo they talk about in the Arch Wiki.
Everything was fine.

I just got a freeze during the update. Lack of luck.

When I was on Debian I was always upgrading in a tty. I think it is a good habit.

Thank you to all for your help.