You are not logged in.

#1 2022-11-26 13:39:28

geoduck
Member
Registered: 2022-11-26
Posts: 11

[SOLVED] error while loading shared libraries: libunistring.so.2

I am a real newbie to Arch Linux. Today I was installing gdb, but when i finished it said that it misses some libraries libunistring... and so on. So I've found them on AUR and installed, but soon after it my pacman started saying: "pacman: error while loading shared libraries: libunistring.so.2: cannot open shared object file: No such file or directory". I briefly fixed it via "sudo cp /usr/lib/libunistring.so.5.0.0 /usr/lib/libunistring.so.2" hmm, but are there any other possible solutions to this problem, which will "revert" the changes and what can i do with this gdb messages to make it work...

Thanks in advance smile

Last edited by geoduck (2022-11-26 16:18:18)


monad is a...

Offline

#2 2022-11-26 13:51:07

Trilby
Inspector Parrot
Registered: 2011-11-29
Posts: 29,523
Website

Re: [SOLVED] error while loading shared libraries: libunistring.so.2

First, don't do partial upgrades (which I'm 99.999% sure is what caused your problem).

Second, packages from the repos will never depend on an AUR package.

Third, never copy / symlink libraries.  This doesn't fix problems, it just varnishes over them generally creating far worse problems.

Fourth, did I say, never do partial upgrades?

The first step in the fix is to fully upgrade your system and reinstall libunistring from the repos:

pacman -Syu
pacman --asdeps libunistring

Answer Y for yes when the second command asks if you want to replace libunistring-git.

Last edited by Trilby (2022-11-26 13:52:54)


"UNIX is simple and coherent..." - Dennis Ritchie, "GNU's Not UNIX" -  Richard Stallman

Offline

#3 2022-11-26 13:51:57

geoduck
Member
Registered: 2022-11-26
Posts: 11

Re: [SOLVED] error while loading shared libraries: libunistring.so.2

there is already something on this: https://bbs.archlinux.org/viewtopic.php?id=281295, but I don't find it very helpful


monad is a...

Offline

#4 2022-11-26 13:58:45

geoduck
Member
Registered: 2022-11-26
Posts: 11

Re: [SOLVED] error while loading shared libraries: libunistring.so.2

I guess I should upgrade my system using live usb? cuz pacman is completely dead at the moment...


monad is a...

Offline

#5 2022-11-26 14:03:44

Scimmia
Fellow
Registered: 2012-09-01
Posts: 11,544

Re: [SOLVED] error while loading shared libraries: libunistring.so.2

Or using pacman-static.

Offline

#6 2022-11-26 14:22:50

Trilby
Inspector Parrot
Registered: 2011-11-29
Posts: 29,523
Website

Re: [SOLVED] error while loading shared libraries: libunistring.so.2

I thought you said copying the library "briefly fixed it".  Did the varnish wear off that quickly?

But yes, using a live usb (or pacman-static) would be the next step.


"UNIX is simple and coherent..." - Dennis Ritchie, "GNU's Not UNIX" -  Richard Stallman

Offline

#7 2022-11-26 14:32:28

geoduck
Member
Registered: 2022-11-26
Posts: 11

Re: [SOLVED] error while loading shared libraries: libunistring.so.2

varnish vanish...ed.

I'm sorry for making too much questions. I tried pacman-static (official prebuilt binary), but it ends with a question: "Import PGP key F296BDE50368C6CE, "T.J. Townsend <blakkheim@archlinux.org>"? [Y/n]", which i answer Y and then comes a minute of waiting and these errors:

error: key "F296BDE50368C6CE" could not be looked up remotely
error: required key missing from keyring
error: failed to commit transaction (unexpected error)
Errors occurred, no packages were upgraded.

I found wiki page, which suggests to regenerate keys via deleting /etc/pacman.d/gnupg and using pacman-key, so should I?


monad is a...

Offline

#8 2022-11-26 14:33:46

Scimmia
Fellow
Registered: 2012-09-01
Posts: 11,544

Re: [SOLVED] error while loading shared libraries: libunistring.so.2

Update archlinux-keyring first.

Offline

#9 2022-11-26 14:57:23

geoduck
Member
Registered: 2022-11-26
Posts: 11

Re: [SOLVED] error while loading shared libraries: libunistring.so.2

didn't help, still have the same minute (even like 5 minutes) to ponder about life and I still get errors about pgp key... so, "pacman-key" method or any other ideas?


monad is a...

Offline

#10 2022-11-26 15:01:42

Scimmia
Fellow
Registered: 2012-09-01
Posts: 11,544

Re: [SOLVED] error while loading shared libraries: libunistring.so.2

There's no way you'd get that error with archlinux-keyring up-to-date.

Offline

#11 2022-11-26 15:07:08

geoduck
Member
Registered: 2022-11-26
Posts: 11

Re: [SOLVED] error while loading shared libraries: libunistring.so.2

well, maybe it's something wrong with me, I run:

1) ./pacman-static -S archlinux-keyring
2) ./pacman-static -Syu
3) ...time passes...
4) errors. hey!! smile


monad is a...

Offline

#12 2022-11-26 15:32:43

geoduck
Member
Registered: 2022-11-26
Posts: 11

Re: [SOLVED] error while loading shared libraries: libunistring.so.2

from what I've seen: in other cases this update (archlinux-keyring) makes something (always solves a problem actually), but in mine it just says that everything is up-to-date and reinstalls it...

maybe some advises..?

Last edited by geoduck (2022-11-26 15:36:26)


monad is a...

Offline

#13 2022-11-26 15:47:21

Slithery
Administrator
From: Norfolk, UK
Registered: 2013-12-01
Posts: 5,776

Re: [SOLVED] error while loading shared libraries: libunistring.so.2

You need to run...

./pacman-static -Sy archlinux-keyring
./pacman-static -Syu

This is the only time when using pacman -Sy <something> is acceptable because you are running a full update straight away afterwards.


No, it didn't "fix" anything. It just shifted the brokeness one space to the right. - jasonwryan
Closing -- for deletion; Banning -- for muppetry. - jasonwryan

aur - dotfiles

Offline

#14 2022-11-26 15:55:59

geoduck
Member
Registered: 2022-11-26
Posts: 11

Re: [SOLVED] error while loading shared libraries: libunistring.so.2

I made a small workaround, but idk how much it will help:

1) cp /usr/lib/libunistring.so.5 /usr/lib/libuinstring.so.2
2) pacman -S --asdeps libunistring
3) pacman -S archlinux-keyring
4) rm /usr/lib/libunistring.so.2
5) ./pacman-static -Syu (it worked somehow, because keys are new)
6) pacman is working it seems and update was successful

P.S. I've tried -Sy too (it didn't help)

let me reboot and check everything, and I'll close this topic

P.S.S. It helped, solved the problem and the subproblem (which is about gdb and valgrind).

Last edited by geoduck (2022-11-26 16:20:28)


monad is a...

Offline

#15 2022-11-26 15:59:22

geoduck
Member
Registered: 2022-11-26
Posts: 11

Re: [SOLVED] error while loading shared libraries: libunistring.so.2

any ideas what I can try doing to test if its working alright?


(after full update gdb is working fine it seems, valgrind too)

Last edited by geoduck (2022-11-26 16:00:18)


monad is a...

Offline

#16 2022-11-26 16:01:26

geoduck
Member
Registered: 2022-11-26
Posts: 11

Re: [SOLVED] error while loading shared libraries: libunistring.so.2

Slithery wrote:

This is the only time when using pacman -Sy <something> is acceptable because you are running a full update straight away afterwards.

Yeah, I understood that, but at that point I've already had the latest keyring as pacman said


monad is a...

Offline

#17 2022-11-26 16:07:11

Slithery
Administrator
From: Norfolk, UK
Registered: 2013-12-01
Posts: 5,776

Re: [SOLVED] error while loading shared libraries: libunistring.so.2

geoduck wrote:

Yeah, I understood that, but at that point I've already had the latest keyring as pacman said

No, you didn't. You just kept reinstalling the package that was already listed in your pacman database.


No, it didn't "fix" anything. It just shifted the brokeness one space to the right. - jasonwryan
Closing -- for deletion; Banning -- for muppetry. - jasonwryan

aur - dotfiles

Offline

#18 2022-11-26 16:14:53

geoduck
Member
Registered: 2022-11-26
Posts: 11

Re: [SOLVED] error while loading shared libraries: libunistring.so.2

Ok, won't argue here, because I am no one, but a newbie. That was my fault, so glad some of your suggestions helped.
I am closing this topic, everything seems to be working after reboot.
Thanks! smile


monad is a...

Offline

#19 2022-11-26 16:46:46

Trilby
Inspector Parrot
Registered: 2011-11-29
Posts: 29,523
Website

Re: [SOLVED] error while loading shared libraries: libunistring.so.2

geoduck wrote:

any ideas what I can try doing to test if its working alright?

If `pacman -Syu` runs without error, it'd seem all is well.  You could also review the output of `pacman -Qkk` for good measure (looking particularly for altered files under /usr/lib), but I doubt that's particularly relevant now.

Last edited by Trilby (2022-11-26 16:47:35)


"UNIX is simple and coherent..." - Dennis Ritchie, "GNU's Not UNIX" -  Richard Stallman

Offline

Board footer

Powered by FluxBB