5

I just finished installing Arch and setting up my wireless connection. I wanted to install additional packages so I tried using pacman.

But with every command I use I get the following error:

pacman: error while loading shared libraries: libcurl.so.4: cannot open shared object file: No such file or library.

But in /usr/local/lib I have the following files/folders:

libcurl.a libcurl.a libcurl.so libcurl.so.4 libcurl.so.4.2.o pkgconfig

So how do I point pacman to these files?

HDW
  • 151
  • you can check the linked libraries by using the command ldd and you cand find the absolute path of an executable by using which for example which bash – user827992 Jul 07 '12 at 18:44

2 Answers2

5

I'm not sure why your libcurl.* files are in /usr/local/lib, but mine are in /usr/lib where they're supposed to be. To confirm ldconfig isn't finding them, use

ldconfig -p | grep curl

It shouldn't print anything, if it does, check the version number, you may have gotten the wrong version.

To rectify this, you need to tell ldconfig where to find the libs. You can either put a symlink from /usr/lib to the appropriate files in /usr/local/lib, or you can tell ldconfig to search there directly:

echo /usr/local/lib | sudo tee -a /etc/ld.so.conf.d/local.conf

Then run sudo ldconfig to update the cache.

And perhaps try and figure out why your libs are in the wrong directory.

Kevin
  • 40,767
  • Ok pacman finds libcurl now but now it doesn't find libgpgme.so.11. I installed gnupg 2.0 but that doesn't help. But "find / -name 'libgpgme*'" doesn't even return anything. Any idea what's happening? – HDW Jul 07 '12 at 19:51
  • Try the instructions here to install libgpgme manually. Has it been a while since you upgraded? A few months ago (though that's testing repos, release may have been more recent), Arch made some big upgrades to pacman, mostly for signing packages and it was a big shitshow (and I do not use the term lightly, it broke two installs of mine twice each, one wouldn't even boot). It seems to be fine after getting the new pacman up and running though. – Kevin Jul 07 '12 at 20:43
  • I did that but now I get two new errors: /usr/local/lib/libcurl.so.4 no version information available (required by /usr/lib/libalpm.so.7) /lib/libc.so.6: version 'GLIB_2.15' not found (required by /usr/lib/libgpgme.1 – HDW Jul 08 '12 at 09:22
3

You need to find out where it's looking for libcurl (and not finding it), as it's obviously not checking /usr/local/lib. First, I recommend running ldd against it to see if any other libraries are missing:

ldd $(which pacman)

I hope you have strace installed, because that's going to be your next tool to find out where it's looking for libcurl files.

strace  -e open -o strace.log $(which pacman)

After you running this, less strace.log and see what files it tried to open, and this will help you determine where it's looking for it. A quick and dirty fix would be to copy (or symlink) the appropriate files from /usr/local/lib to where it's looking for it.

Here's what I got when I strace'd wget:

open("/etc/ld.so.cache", O_RDONLY|O_CLOEXEC) = 3
open("/lib/x86_64-linux-gnu/libssl.so.1.0.0", O_RDONLY|O_CLOEXEC) = 3
open("/lib/x86_64-linux-gnu/libcrypto.so.1.0.0", O_RDONLY|O_CLOEXEC) = 3
open("/usr/lib/x86_64-linux-gnu/libidn.so.11", O_RDONLY|O_CLOEXEC) = 3
open("/lib/x86_64-linux-gnu/librt.so.1", O_RDONLY|O_CLOEXEC) = 3
open("/lib/x86_64-linux-gnu/libc.so.6", O_RDONLY|O_CLOEXEC) = 3
open("/lib/x86_64-linux-gnu/libdl.so.2", O_RDONLY|O_CLOEXEC) = 3
open("/lib/x86_64-linux-gnu/libz.so.1", O_RDONLY|O_CLOEXEC) = 3
open("/lib/x86_64-linux-gnu/libpthread.so.0", O_RDONLY|O_CLOEXEC) = 3
open("/usr/lib/locale/locale-archive", O_RDONLY|O_CLOEXEC) = 3
open("/etc/wgetrc", O_RDONLY)           = 3
open("/usr/share/locale/locale.alias", O_RDONLY|O_CLOEXEC) = 3
open("/usr/share/locale/\"en_US/LC_MESSAGES/wget.mo", O_RDONLY) = -1 ENOENT (No such file or directory)
open("/usr/share/locale/\"en/LC_MESSAGES/wget.mo", O_RDONLY) = -1 ENOENT (No such file or directory)
open("/usr/share/locale-langpack/\"en_US/LC_MESSAGES/wget.mo", O_RDONLY) = -1 ENOENT (No such file or directory)
open("/usr/share/locale-langpack/\"en/LC_MESSAGES/wget.mo", O_RDONLY) = -1 ENOENT (No such file or directory)
open("/usr/share/locale/en\"/LC_MESSAGES/wget.mo", O_RDONLY) = -1 ENOENT (No such file or directory)
open("/usr/share/locale-langpack/en\"/LC_MESSAGES/wget.mo", O_RDONLY) = -1 ENOENT (No such file or directory)
laebshade
  • 2,176