login failing - error where loading shared libraries

This forum is for discussion about general software issues.

login failing - error where loading shared libraries

Postby jayuu » Mon Jun 03, 2019 8:34 pm

Hi Forum, Have been enjoying using ArchLinux Arm on a pi3 for a while. This included using a postgres instance which was failing after libreadline https://wiki.archlinux.org/index.php/Readline was upgraded from v7 to v8.

I downloaded to version 7 using the cache and instructions here https://wiki.archlinux.org/index.php/Downgrading_packages

I then rebooted the system.

Since then I've been unable to login to the system. ssh logs in and then straight out again with the following message:
$this->bbcode_second_pass_quote('', 'L')ast login: Mon Jun 3 19:49:53 2019
-bash: error while loading shared libraries: libreadline.so.8: cannot open shared object file: No such file or directory
Connection to pi3 closed.


If I plug the pi3 directly into an HDMI monitor and keyboard and try to log in it immediately bounces me back to the same login prompt.

Just wondering how to go about addressing a fix for this?

Many thanks.
jayuu
 
Posts: 5
Joined: Mon Jun 03, 2019 7:41 pm

Re: login failing - error where loading shared libraries

Postby karog » Mon Jun 03, 2019 9:29 pm

You should not have downgraded Readline from 8 to 7. That is what is biting you. Downgrading removed libreadline.so.8 and replaced it with libreadline.so.7 and so somewhere in your login process, the failure to find the v8 lib is the problem.

Presumably when postgres failed, it was complaining about v7 missing. You needed to install the missing older library. Another way that often works is to make a soft link from the older version name to the newer version name. As long as the API did not change, and the same function is performed, this can work. I keep copies of all lib versions in a backup so that if some lib gets replaced, I have a copy of the old one to put back in.

To fix your current situation, mount the upgraded disk on another linux machine. There are ways to upgrade the Readline package for the attached disk rather than the current system on this other machine. But I am too rusty on that. Instead you could try making a soft link to point libreadline.so.8 to the currently installed libreadline.so.7.0. That might be enough to let you boot the disk again and login. Then upgrade Readline again to v8 and make a soft link for v7 to 8. To do this correctly, first look at all the files and links for libreadline.so in /lib and see which you should link to. For example, I currently have
$this->bbcode_second_pass_code('', '$ ls -lh libreadline*
lrwxrwxrwx 1 root root 16 Jan 13 09:12 libreadline.so -> libreadline.so.8
lrwxrwxrwx 1 root root 18 Jan 13 09:12 libreadline.so.8 -> libreadline.so.8.0
-rwxr-xr-x 1 root root 355K Jan 13 09:12 libreadline.so.8.0
')
karog
 
Posts: 300
Joined: Thu Jan 05, 2012 7:55 pm

Re: login failing - error where loading shared libraries

Postby jayuu » Sun Jun 16, 2019 10:27 am

Many thanks for the reply. I tried the symlink suggestion

$this->bbcode_second_pass_code('', '
mkdir ~/broken_arm
sudo mount /dev/sdb2 ~/broken_arm
cd ~/broken_arm/usr/lib
sudo ln -s libreadline.so.8 libreadline.so.7.0*
sudo ln -s libreadline.so.8.0 libreadline.so.7.0*
')

Some progress as where logging in again but now seeing this

$this->bbcode_second_pass_code('', '
Welcome to Arch Linux ARM

Website: http://archlinuxarm.org
Forum: http://archlinuxarm.org/forum
IRC: #archlinux-arm on irc.Freenode.net
Last login: Sun Jun 16 10:10:14 2019 from xxx.xxx.xx.xxx
-bash: symbol lookup error: -bash: undefined symbol: history_quoting_state
Connection to pi3 closed.
')

Where attempting a login from Putty or directly the screen just closes. SSH on Win 10 or from another Linux box shows the same message as per the above.

Had a quick google of the error code but nothing obvious in terms of a fix showed up.

I've been looking to create another Arm Pi3 install using the Armv8 install. This had the libreadline.so.8 installed so I tried to copy those libraries into the usr/lib directory but got the following error:

$this->bbcode_second_pass_code('', '
-bash: error while loading shared libraries: libreadline.so.8: wrong ELF class: ELFCLASS64
')

Not sure where to go from here. Possibly installing libreadline into the mounted (broken) installation. Would it make a differece regading the host? (ie. Arch 32 ; Arch 64; ArmV8)

Many thanks.
jayuu
 
Posts: 5
Joined: Mon Jun 03, 2019 7:41 pm

Re: login failing - error where loading shared libraries

Postby jayuu » Tue Jul 23, 2019 11:13 am

Resolved by creating a new installation and using the old postgres data directory.
jayuu
 
Posts: 5
Joined: Mon Jun 03, 2019 7:41 pm


Return to General

Who is online

Users browsing this forum: No registered users and 8 guests