PC froze in the middle of the update

Hi community. Yesterday i ran sudo pacman -Syu, but after all the packages were downloaded and the system starts upgrade them my pc frozes out and i have not choise other than restart, obviously when i try to load again the O.S the first error was that the kernel file was not found so i make an manjaro live usb and boot it to try to solve my problem:
The first in my mind was sudo manjaro-chroot -a but that shows me the following error:
bin/bash: error while loading shared libraries: /usr/lib/libncursesw.so.6: file too short
i kept searching for an answer and try out all this:
since i can’t run sudo manjaro-chroot -a i followed this guide
https://wiki.archlinux.org/title/Pacman#Pacman_crashes_during_an_upgrade
but when get to the step 4 to pacman --sysroot /mnt -Syu thats show me:
error: GPGME error: Invalid crypto engine

following this:
https://bbs.archlinux.org/viewtopic.php?id=271634
i could try to run this :
pacman --root /mnt --cachedir /mnt/var/cache/pacman/pkg -Syu gnupg

but returns me the same:
/bin/bash: error while loading shared libraries: /usr/lib/libncursesw.so.6: file too short

Another thing i tried was:
pacman --root /mnt --cachedir /mnt/var/cache/pacman/pkg -S ncurses

but shows me several errors:
error: failed to commit transaction (conflicting files) ncurses: /mnt/usr/bin/captoinfo exists in filesystem ncurses: /mnt/usr/bin/clear exists in filesystem ncurses: /mnt/usr/bin/infocmp exists in filesystem ncurses: /mnt/usr/bin/infotocap exists in filesystem ncurses: /mnt/usr/bin/ncursesw6-config exists in filesystem

indicating that a lot of files already exist, and if i try to:
pacman --root /mnt --cachedir /mnt/var/cache/pacman/pkg -S ncurses --overwrite "*"

i get the following error again:
/bin/bash: error while loading shared libraries: /usr/lib/libncursesw.so.6: file too short

finally i check for size of this /usr/lib/libncursesw.so.6 file and it was 0kb

so first can you succesfully chroot with the: sudo manjaro-chroot -a command? the text changes color to red if it went ok

No i can’t run sudo manjaro-chroot -a because shows me the following error:
bin/bash: error while loading shared libraries: /usr/lib/libncursesw.so.6: file too short

are you using manjaro iso?
try chrooting manually with this without the manjaro-chroot -a command… if you cant chroot, i dont know how do you want to repair your system…

following your guide i get the same output:

[manjaro@manjaro ~]$ sudo mount /dev/sdc4 /mnt
[manjaro@manjaro ~]$ sudo su
[manjaro manjaro]# manjaro-chroot /mnt /bin/bash
/bin/bash: error while loading shared libraries: /usr/lib/libncursesw.so.6: file too short
[manjaro manjaro]#
[manjaro@manjaro ~]$ sudo manjaro-chroot -a
grub-probe: error: cannot find a GRUB drive for /dev/sdd1.  Check your device.map.
grub-probe: error: cannot find a GRUB drive for /dev/sdd1.  Check your device.map.
==> Mounting (ManjaroLinux) [/dev/sdc4]
 --> mount: [/mnt]
 --> mount: [/mnt/home]
 --> mount: [/mnt/boot/efi]
/bin/bash: error while loading shared libraries: /usr/lib/libncursesw.so.6: file too short
 --> umount: [/mnt/boot/efi]
 --> umount: [/mnt/home]
 --> umount: [/mnt]

can you provide output from: ls -l /usr/lib/libncursesw.*

here:

[manjaro manjaro]# ls -l /usr/lib/libncursesw.*
lrwxrwxrwx 1 root root     16 Feb  3 21:16 /usr/lib/libncursesw.so -> libncursesw.so.6
lrwxrwxrwx 1 root root     18 Feb  3 21:16 /usr/lib/libncursesw.so.6 -> libncursesw.so.6.3
-rwxr-xr-x 1 root root 470232 Feb  3 21:16 /usr/lib/libncursesw.so.6.3

edit your post and click this icon in editor: </> and put the output there …

fixed, sorry

same command but ran over /mnt mounted point:

[manjaro manjaro]# ls -l /mnt/usr/lib/libncursesw.*
lrwxrwxrwx 1 root root 16 Apr 28 09:55 /mnt/usr/lib/libncursesw.so -> libncursesw.so.6
lrwxrwxrwx 1 root root 18 May 15 15:11 /mnt/usr/lib/libncursesw.so.6 -> libncursesw.so.6.3
-rwxr-xr-x 1 root root  0 Apr 28 09:55 /mnt/usr/lib/libncursesw.so.6.3

hopefully this is correct:
ln -s libncursesw.so.6.3 libncursesw.so.6
ln -s libncursesw.so.6 libncursesw.so

sorry, i must be inside an specific dir path to run those?
i mean, inside:
/usr/lib/
or:
/mnt/usr/lib/

this will create symlink and fix the ‘file is to short’ issue, but since you cannot chroot it looks like its not working …

so try using mount as you suggest

[manjaro lib]# pwd
/mnt/usr/lib
[manjaro lib]# manjaro-chroot /mnt /bin/bash
/bin/bash: error while loading shared libraries: /usr/lib/libncursesw.so.6: file too short
[manjaro lib]# ln -s libncursesw.so.6.3 libncursesw.so.6
ln: failed to create symbolic link 'libncursesw.so.6': File exists
[manjaro lib]# ln -s libncursesw.so.6 libncursesw.so
ln: failed to create symbolic link 'libncursesw.so': File exists

i should rm any file first?

yes try removing: rm libncursesw.so.6 libncursesw.so
and then try again creating the symlinks

same error:

[manjaro lib]# cd /mnt/usr/lib
[manjaro lib]# rm libncursesw.so.6 libncursesw.so
[manjaro lib]# ln -s libncursesw.so.6.3 libncursesw.so.6
[manjaro lib]# ln -s libncursesw.so.6 libncursesw.so
[manjaro lib]# manjaro-chroot /mnt /bin/bash
/bin/bash: error while loading shared libraries: /usr/lib/libncursesw.so.6: file too short

but check this:
libncursesw.so.6.3 file size is 0bytes
so i think the file is corrupt, may i copy the same file located in /usr/lib that belongs to the system loaded by the live-usb?
is the exact same version so.6.3 and the size is 459.2KiB
what do you think?

yes try that … if it doesnt work create again the symlinks with the new file from the usb

it worked like a charm my friend!!!, im going to try to update a package now, if nothing more cause me errors i’ll put solution tag to your post

great, so rerun the update again: pamac update
and i dont think that only running the update again will be enough, also reinstalling kernels, checking graphics, running update grub and mkinitcpio … let me know how it went with the update

hey brahma, i’ve been a liitle bussy here so, i ran pamac update and give me this error:

[manjaro /]# pamac update                                                      
Warning: Building packages as dynamic user
Warning: Setting build directory to /var/cache/pamac
Preparing...
Synchronizing package databases...
https://mirrors.manjaro.org/repo/stable/core/x86_64/core.db: Unacceptable TLS certificate
Failed to synchronize databases
https://aur.manjaro.org/packages-meta-ext-v1.json.gz: Unacceptable TLS certificate
Failed to synchronize AUR database
Failed to query https://aur.archlinux.org/rpc/?v=5&type=info&arg[]=gnome-icon-theme&arg[]=gnome-icon-theme-symbolic&arg[]=google-chrome&arg[]=insomnia-bin&arg[]=qpdfview&arg[]=rtl8812au-dkms-git&arg[]=smartgit&arg[]=visual-studio-code-bin&arg[]=yay-git from AUR: Unacceptable TLS certificate
Failed to initialize alpm library (could not find or read directory)

** (pamac:172): WARNING **: 20:54:22.100: alpm_utils.vala:290: Failed to initialize alpm library
Error: Alpm Error: Failed to initialize alpm library

and if run pacman -S samba for example give this error instead:

:: Proceed with installation? [Y/n] 
(2/2) checking keys in keyring                     [######################] 100%
(2/2) checking package integrity                   [######################] 100%
(2/2) loading package files                        [######################] 100%
(2/2) checking for file conflicts                  [######################] 100%
(2/2) checking available disk space                [######################] 100%
:: Running pre-transaction hooks...
(1/1) Creating Timeshift snapshot before upgrade...
Wrong paramater in /etc/timeshift-autosnap.conf. Using skipAutosnap=false
Wrong paramater in /etc/timeshift-autosnap.conf. Using skipRsyncAutosnap=false
Wrong paramater in /etc/timeshift-autosnap.conf. Using snapshotDescription={timeshift-autosnap} {created before upgrade}
Application needs admin access.
Please run the application as admin (using 'sudo' or 'su')
Unable to run timeshift-autosnap! Please close Timeshift and try again. Script will now exit...
error: command failed to execute correctly
error: failed to commit transaction (failed to run transaction hooks)
Errors occurred, no packages were upgraded.