You are not logged in.

#1 2013-03-27 14:56:08

windexh8er
Member
Registered: 2008-05-04
Posts: 32

Shared Libraries - libncursesw.so.5? [SOLVED]

I just upgraded a test system and there was a kernel upgrade as well.  Everything went without a hitch on my test platform until I rebooted - now when I try to login via the local TTY I am immediately logged back out (no matter what user) to the login prompt.  I had to record the error with slow motion video to be able to see what the error was that was flashing for less than a second on the screen but it looks to be along the lines of:

error while loading shared libraries: /usr/lib/libncursesw.so

...and from there the screen is cut off.

Thoughts?

Thanks...

Edit: use --> user

Last edited by windexh8er (2013-03-27 17:05:20)

Offline

#2 2013-03-27 14:58:48

jakobcreutzfeldt
Member
Registered: 2011-05-12
Posts: 1,042

Re: Shared Libraries - libncursesw.so.5? [SOLVED]

Can you ssh in to try to reinstall ncurses? Otherwise,  boot a live cd and chroot in to try reinstalling it.

Offline

#3 2013-03-27 15:03:57

windexh8er
Member
Registered: 2008-05-04
Posts: 32

Re: Shared Libraries - libncursesw.so.5? [SOLVED]

No, I don't have SSH enabled on it.  Dreading the LiveCD method since it's an encrypted LVM - always fun to chroot.  Any thoughts on why?  The mirror wasn't out of sync when I Syu'd.

Offline

#4 2013-03-27 15:15:22

ewaller
Administrator
From: Pasadena, CA
Registered: 2009-07-13
Posts: 20,642

Re: Shared Libraries - libncursesw.so.5? [SOLVED]

You did not mention which boot loader you are using, so I cannot be specific on how to do this, but......

From your boot loader, tell the kernel to use /usr/bin/bash as the init system.  It should put you in a shell, but you will have limited functionality.  From there, you should be able to reinstall from the cache.  If you need a network, you will have to do some setup by hand.

Edit:  As I continue to think about it, you might also consider telling the kernel just to boot to single user mode and see if that helps.

Last edited by ewaller (2013-03-27 15:16:53)


Nothing is too wonderful to be true, if it be consistent with the laws of nature -- Michael Faraday
The shortest way to ruin a country is to give power to demagogues.— Dionysius of Halicarnassus
---
How to Ask Questions the Smart Way

Offline

#5 2013-03-27 15:29:30

windexh8er
Member
Registered: 2008-05-04
Posts: 32

Re: Shared Libraries - libncursesw.so.5? [SOLVED]

Grub2.

Tried single user and no dice, same result.  Didn't try the /usr/bin/bash to init - can't say I've ever done that.  Won't I likely get the same problem there since it seems that bash is reliant on the library in question?

Offline

#6 2013-03-27 15:45:39

ewaller
Administrator
From: Pasadena, CA
Registered: 2009-07-13
Posts: 20,642

Re: Shared Libraries - libncursesw.so.5? [SOLVED]

windexh8er wrote:

Won't I likely get the same problem there since it seems that bash is reliant on the library in question?

It would seem so sad

ewaller@odin:~ 1016 %ldd /usr/bin/bash
        linux-vdso.so.1 (0x00007fff939fe000)
        libreadline.so.6 => /usr/lib/libreadline.so.6 (0x00007f2915c65000)
        libncursesw.so.5 => /usr/lib/libncursesw.so.5 (0x00007f2915a06000)
        libdl.so.2 => /usr/lib/libdl.so.2 (0x00007f2915802000)
        libc.so.6 => /usr/lib/libc.so.6 (0x00007f2915455000)
        /lib64/ld-linux-x86-64.so.2 (0x00007f2915eab000)
ewaller@odin:~ 1017 %

Sorry about that.  zsh uses it too.  rsh doesn't

ewaller@odin:~ 1017 %ldd /usr/bin/rsh
        linux-vdso.so.1 (0x00007f57ceb71000)
        libc.so.6 => /usr/lib/libc.so.6 (0x00007f57ce786000)
        /lib/ld-linux-x86-64.so.2 => /usr/lib64/ld-linux-x86-64.so.2 (0x00007f57ceb73000)
ewaller@odin:~ 1018 %

Question is, can you work your way out of this pickle with rsh?  I don't think so.


Edit:  You might try and see if you can invoke bash with the -noediting switch.  It causes an interactive shell to not use the readline library.  That could be what is trying to pull in libncursesw.so.

Last edited by ewaller (2013-03-27 15:50:57)


Nothing is too wonderful to be true, if it be consistent with the laws of nature -- Michael Faraday
The shortest way to ruin a country is to give power to demagogues.— Dionysius of Halicarnassus
---
How to Ask Questions the Smart Way

Offline

#7 2013-03-27 15:55:18

progandy
Member
Registered: 2012-05-17
Posts: 5,317

Re: Shared Libraries - libncursesw.so.5? [SOLVED]

Try to boot with the parameter break=postmount. Then you will be dropped to an initramfs shell with your root-filesystem in /new_root. Try to use the cached versions from /new_root/var/cache/pacman/pkg to restore the corrupt files, exit the shell and continue to boot.
https://wiki.archlinux.org/index.php/Mkinitcpio#init

Edit: For just those cases I have a static busybox installed. All busybox modules are symlinked in /usr/lib/busybox. Since bash is not included, I have a static version there (from debian, I did not want to compile it), too. Using a rescue shell is now simple: /usr/lib/busybox/sh, (if you need bash, call it with PATH="/usr/lib/busybox:$PATH" bash)
Edit: If you need a busybox but you cannot install it, you can download a binary version here.

Last edited by progandy (2013-03-27 16:29:17)


| alias CUTF='LANG=en_XX.UTF-8@POSIX ' | alias ENGLISH='LANG=C.UTF-8 ' |

Offline

#8 2013-03-27 16:28:54

windexh8er
Member
Registered: 2008-05-04
Posts: 32

Re: Shared Libraries - libncursesw.so.5? [SOLVED]

The break=postmount worked to get into the box and I see the files in the cache.

Question now is how do I correctly use pacman in this state?  I exported LD_LIBRARY_PATH to the /new_root/lib but now I'm running into problems working with pacman offline.  I tried a few options of -U / -Ud, tried modifying the pacman.conf to reflect the /new_root location, etc.  But - is there just an easier way I can get pacman to install this without checking anything?

Thanks!

Offline

#9 2013-03-27 16:39:06

progandy
Member
Registered: 2012-05-17
Posts: 5,317

Re: Shared Libraries - libncursesw.so.5? [SOLVED]

I think you should extract and replace the one file manually. I am not sure how pacman will work with a broken bash (it is required for the installscripts)

# extract all ncurses libraries
xz -dc /var/cache/pacman/pkg/ncurses-5.9-5-x86_64.pkg.tar.xz  | tar -xv usr/lib/libncur*

| alias CUTF='LANG=en_XX.UTF-8@POSIX ' | alias ENGLISH='LANG=C.UTF-8 ' |

Offline

#10 2013-03-27 16:56:30

windexh8er
Member
Registered: 2008-05-04
Posts: 32

Re: Shared Libraries - libncursesw.so.5? [SOLVED]

So close, but since the new_root is read-only I can't overwrite...  Is there a way to do the postmount in a rw manner?

Edit: mount -o remount,rw /new_root
#duh

Last edited by windexh8er (2013-03-27 17:01:59)

Offline

#11 2013-03-27 17:02:42

progandy
Member
Registered: 2012-05-17
Posts: 5,317

Re: Shared Libraries - libncursesw.so.5? [SOLVED]

windexh8er wrote:

So close, but since the new_root is read-only I can't overwrite...  Is there a way to do the postmount in a rw manner?

issue a mount -o remount,rw /new_root
Edit: You found it wink

Last edited by progandy (2013-03-27 17:03:05)


| alias CUTF='LANG=en_XX.UTF-8@POSIX ' | alias ENGLISH='LANG=C.UTF-8 ' |

Offline

#12 2013-03-27 17:04:49

windexh8er
Member
Registered: 2008-05-04
Posts: 32

Re: Shared Libraries - libncursesw.so.5? [SOLVED]

And that was it, fixed.  smile  Thanks much!

Edit:
Do the 64bit libs just always get copied over into /lib as well as /lib64?  Not sure if I should add them over in /lib as well...

Last edited by windexh8er (2013-03-27 17:08:47)

Offline

#13 2013-03-27 17:23:10

windexh8er
Member
Registered: 2008-05-04
Posts: 32

Re: Shared Libraries - libncursesw.so.5? [SOLVED]

And, unfortunately - I think other things were broken in the process of the upgrade.  Bummer.

Offline

#14 2013-03-27 17:43:44

progandy
Member
Registered: 2012-05-17
Posts: 5,317

Re: Shared Libraries - libncursesw.so.5? [SOLVED]

windexh8er wrote:

And that was it, fixed.  smile  Thanks much!

Edit:
Do the 64bit libs just always get copied over into /lib as well as /lib64?  Not sure if I should add them over in /lib as well...

With x86_64 the paths /lib, /lib64, and usr/lib64 are symlinks to usr/lib.

And, unfortunately - I think other things were broken in the process of the upgrade.  Bummer.

When you get pacman running again, you should reinstall all your packages. pacman -Qq | xargs pacman -S


| alias CUTF='LANG=en_XX.UTF-8@POSIX ' | alias ENGLISH='LANG=C.UTF-8 ' |

Offline

#15 2013-03-27 17:53:51

windexh8er
Member
Registered: 2008-05-04
Posts: 32

Re: Shared Libraries - libncursesw.so.5? [SOLVED]

I just got things back to working by reinstalling everything that said that there was an empty file associated with a library.  Why would/does this happen?

Going to reinstall now.

Is this indicative of a failed upgrade (pacman.log showed nothing but success) or is it indicative of something with the disk (an SSD in this system that's only about 4 months old)?

Thanks for all of you help @progandy!

Edit: How do you deal with packages installed by yaourt if you want to reinstall the system?  Things like "hal" bomb out the system reinstall command.

Edit_2: I just did:

pacman -Qet | awk '{print $1}' > /tmp/installed_pkgs.txt

...pulled out the outliers by hand and then ran pacman against that list.

Last edited by windexh8er (2013-03-27 18:18:30)

Offline

#16 2013-03-27 18:19:53

progandy
Member
Registered: 2012-05-17
Posts: 5,317

Re: Shared Libraries - libncursesw.so.5? [SOLVED]

Edit: How do you deal with packages installed by yaourt if you want to reinstall the system?  Things like "hal" bomb out the system reinstall command.

You can do it this way, too:

 (pacman -Qq ; pacman -Qqm) | sort | uniq -u # aur packages will occur as duplicates, remove them
# or use comm to compare sorted data from two filedescriptors
comm -23 <(pacman -Qq | sort) <(pacman -Qqm | sort) 

| alias CUTF='LANG=en_XX.UTF-8@POSIX ' | alias ENGLISH='LANG=C.UTF-8 ' |

Offline

#17 2013-03-27 19:41:14

windexh8er
Member
Registered: 2008-05-04
Posts: 32

Re: Shared Libraries - libncursesw.so.5? [SOLVED]

Any thoughts on why this would have happened in the first place?  I've run into something similar twice now this year on two different systems.  Both are identical from a hardware perspective...

Offline

#18 2013-03-27 19:53:30

progandy
Member
Registered: 2012-05-17
Posts: 5,317

Re: Shared Libraries - libncursesw.so.5? [SOLVED]

Maybe there is a bug in the SSD firmware when there are many overwrite requests? Or a bug in the kernel driver. If i am not mistaken, the SSD will have to mark the old file as deleted and then write it to a new flash chip. Maybe it loses some write operations?

Last edited by progandy (2013-03-27 19:54:23)


| alias CUTF='LANG=en_XX.UTF-8@POSIX ' | alias ENGLISH='LANG=C.UTF-8 ' |

Offline

Board footer

Powered by FluxBB