Question
You receive the following type error when trying to execute ./nzload,, ./nzdz or other nz commands.
./ nzload error while loading shared libraries: libz.so.1: cannot open shared object file: No such file or directory
./nzsql: error while loading shared libraries: libz.so.1: cannot open shared object file: No such file or directory
Cause
More than likely the library is not installed on your system and you need to install it.
Answer
1. see if the library exist on your system:
locate libz.so.1
— or —
find / -name libz.so.1
2. Perhaps the library is not installed on your system and you need to install it. Here what you need:
yum provides ‘*/libz.so.1’
3. Is the environment variable LD_LIBRARY_PATH set and pointing to the folder where the libz.so.1 is located?
4. Copy the library’s over from another machine to the linux client machine
[{«Product»:{«code»:»SSULQD»,»label»:»IBM PureData System»},»Business Unit»:{«code»:»BU053″,»label»:»Cloud & Data Platform»},»Component»:»IBM Netezza Analytics»,»Platform»:[{«code»:»PF025″,»label»:»Platform Independent»}],»Version»:»1.0.0″,»Edition»:»»,»Line of Business»:{«code»:»LOB10″,»label»:»Data and AI»}}]
The Problem
When executing rpm command, the following error is seen:
rpm: error while loading shared libraries: libz.so.1: cannot open shared object file: No such file
The zlib shard libraries are missing:
# ls -l /lib64/libz.so* ls: /lib64/libz.so*: No such file or directory # ls -l /lib/libz.so* ls: /lib/libz.so*: No such file or directory
The Solution
The zlib was broken, normally zlib contains the following files.
On x86_64 platform:
# rpm -ql zlib-1.2.3-27.el6.x86_64 /lib64/libz.so.1 /lib64/libz.so.1.2.3 /usr/share/doc/zlib-1.2.3 /usr/share/doc/zlib-1.2.3/ChangeLog /usr/share/doc/zlib-1.2.3/FAQ /usr/share/doc/zlib-1.2.3/README
On x86 platform:
# rpm -ql zlib-1.2.3-27.el6.i686 /lib/libz.so.1 /lib/libz.so.1.2.3 /usr/share/doc/zlib-1.2.3 /usr/share/doc/zlib-1.2.3/ChangeLog /usr/share/doc/zlib-1.2.3/FAQ /usr/share/doc/zlib-1.2.3/README
While the zlib is broken, the rpm command is broken as well. So we can’t simply use rpm or yum command to reinstall the zlib. What you can do here is:
1. On another CentOS/RHEL server, extract zlib share libraries from a rpm with same version (e.g. zlib-1.2.3-27.el6 here).
2. Decompress the rpm:
# rpm2cpio zlib-1.2.3-27.el6.[arch].rpm | cpio -idvm
3. Subsitute [arch] to x86_64 or i686 depending on your server architecture:
# rpm2cpio zlib-1.2.3-27.el6.x86_64.rpm | cpio -idvm ./lib64/libz.so.1 ./lib64/libz.so.1.2.3 ./usr/share/doc/zlib-1.2.3 ./usr/share/doc/zlib-1.2.3/ChangeLog ./usr/share/doc/zlib-1.2.3/FAQ ./usr/share/doc/zlib-1.2.3/README 300 blocks
4. Move the lib.so.1.2.3 and lib.so.1 to the correct location:
On x86_64 platform:
# mv ./lib64/libz.so.* /lib64
On x86 platform:
# mv ./lib/libz.so.* /lib
5. Rebuild the library cache:
Now the rpm command should run as normal.
6. Optionally, reinstall the zlib to fix other possible issues:
Notes
Similar issue can occur for other packages like mentioned below:
rpm: error while loading shared libraries: libdb-4.7.so: cannot open shared object file: No such file or directory
In order to resolve this, find which package supplies the missing file:
# yum provides */libdb* Loaded plugins: security, ulninfo db4-4.7.25-19.el6_6.i686 : The Berkeley DB database library (version 4) for C Repo : ol6_latest_local Matched from: Filename : /usr/lib/libdb-4.7.so Filename : /lib/libdb-4.7.so
Reinstall the package, or copy the missing file extracting the rpm.
Содержание
- Ошибка error while loading shared libraries
- Что означает error while loading shared libraries?
- Как исправить ошибку?
- 1. Библиотека не установлена
- 2. Библиотека находится не в том каталоге
- 3. Неверная версия библиотеки
- Выводы
- Arch Linux
- #1 2015-08-26 11:35:18
- [SOLVED] Darktable: error while loading shared libraries
- #2 2015-08-26 12:47:12
- Re: [SOLVED] Darktable: error while loading shared libraries
- #3 2015-08-26 12:53:12
- Re: [SOLVED] Darktable: error while loading shared libraries
- #4 2015-08-26 14:23:12
- Re: [SOLVED] Darktable: error while loading shared libraries
- #5 2015-08-26 22:34:12
- Re: [SOLVED] Darktable: error while loading shared libraries
- #6 2015-09-01 13:46:39
- Re: [SOLVED] Darktable: error while loading shared libraries
- #7 2015-09-01 13:55:31
- Re: [SOLVED] Darktable: error while loading shared libraries
- #8 2015-09-01 14:29:51
- Re: [SOLVED] Darktable: error while loading shared libraries
- #9 2015-09-01 14:53:11
- Re: [SOLVED] Darktable: error while loading shared libraries
- Arch Linux
- #1 2017-05-04 17:20:26
- [SOLVED] yaourt libcrypto.so.1.0.0: error
- #2 2017-05-04 17:21:58
- Re: [SOLVED] yaourt libcrypto.so.1.0.0: error
- #3 2017-05-04 17:34:09
- Re: [SOLVED] yaourt libcrypto.so.1.0.0: error
- #4 2017-05-04 19:56:22
- Re: [SOLVED] yaourt libcrypto.so.1.0.0: error
- #5 2017-05-05 07:04:39
- Re: [SOLVED] yaourt libcrypto.so.1.0.0: error
- #6 2017-05-05 07:12:47
- Re: [SOLVED] yaourt libcrypto.so.1.0.0: error
- #7 2017-05-05 07:12:49
- Re: [SOLVED] yaourt libcrypto.so.1.0.0: error
- #8 2017-05-05 07:39:24
- Re: [SOLVED] yaourt libcrypto.so.1.0.0: error
- #9 2017-05-05 08:37:32
- Re: [SOLVED] yaourt libcrypto.so.1.0.0: error
- #10 2017-05-05 10:32:57
- Re: [SOLVED] yaourt libcrypto.so.1.0.0: error
- #11 2017-05-05 17:19:34
- Re: [SOLVED] yaourt libcrypto.so.1.0.0: error
Новые и опытные пользователи Linux могут сталкиваться с ошибкой error loading shared libraries во время запуска программ, также с ней могут сталкиваться программисты и все желающие компилировать программное обеспечение в своей системе. Эта ошибка в дословном переводе означает что возникла проблема во время загрузки общей библиотеки. О том что такое библиотеки и зачем они нужны вы можете узнать из статьи библиотеки Linux.
В этой же статье мы рассмотрим что значит ошибка error while loading shared libraries более подробно, а главное, как ее решить.
Даже если вы не компилируете свои программы, то вы можете увидеть ошибку error while loading shared libraries: имя_библиотеки: cannot open shared object file: No such file or directory достаточно часто во время установки новых программ не через пакетный менеджер или программ, предназначенных для другого дистрибутива. Как я уже говорил, она возникает потому, что система не может найти библиотеку.
А вот почему ее нельзя найти и загрузить, это уже интересно. Этому может быть несколько причин:
- Библиотека не установлена в системе;
- Библиотека установлена, но неизвестно куда;
- Библиотека установлена правильно, но имеет не ту версию.
При решении проблемы мы будем руководствоваться именно этими причинами и пытаться их решить.
Как исправить ошибку?
1. Библиотека не установлена
Первый вариант, тут все понятно, библиотеки просто нет в системе, поэтому мы и получаем такую ошибку. Верный способ ее решения — просто найти пакет библиотеки с помощью пакетного менеджера и установить ее. Обычно, пакеты с библиотеками называются так же, как и сами библиотеки с префиксом lib.
Например, если нам не хватает библиотеки libfuse2.so, то мы можем найти ее в Ubuntu такой командой:
sudo apt search libfuse2
Затем осталось только установить ее:
sudo apt install libfuse2
Если перед вами стоит задача собрать программу из исходников, то вам понадобится не только установить саму библиотеку, но и заголовочные файлы для нее:
sudo apt install libfuse-dev
И так для любой библиотеки. Но это не всегда помогает.
2. Библиотека находится не в том каталоге
Бывает что библиотека установлена, мы установили ее или она поставлялась вместе с программой, но ошибка как была, так и есть. Причиной этому может быть то, что загрузчик Linux не может найти библиотеку.
Поиск библиотек выполняется по всех папках, которые указаны в конфигурационных файлах /etc/ld.conf.d/. По умолчанию, это такие каталоги, как /usr/lib, /lib, /usr/lib64, /lib64. Если библиотека установлена в другой каталог, то, возможно, это и есть причина проблемы.
Вы можете посмотреть какие библиотеки сейчас доступны загрузчику с помощью команды:
Найти, где находится ваша библиотека можно с помощью команды locate. Например, нас интересует библиотека librtfreader.so:
Теперь мы знаем, что она находится по адресу /opt/kingsoft/wps-office/office6/. А значит, для работы программы необходимо сделать чтобы загрузчик библиотек ее видел. Для этого можно добавить путь в один из файлов /etc/ld.so.conf.d/ или же в переменную LD_LIBRARY_PATH:
Опять же, так вы можете поставить с любой библиотекой, которая взывает ошибку. Еще один более простой метод — это просто создать символическую ссылку на нужную библиотеку в правильной папке:
ln -s /opt/kingsoft/wps-office/office6/librtfreader.so /usr/lib/librtfreader.so
3. Неверная версия библиотеки
Эта причина ошибки довольно часто встречается при использовании программ не для вашего дистрибутива. Каждая библиотека имеет дополнительную версию, так называемую ревизию, которая записывается после расширения .so. Например, libav.so.1. Так вот, номер версии меняется всякий раз, когда в библиотеку вносятся какие-либо исправления.
Часто возникает ситуация, когда в одном дистрибутиве программа собирается с зависимостью от библиотеки, например, libc.so.1, а в другом есть только libc.so.2. Отличия в большинстве случаев здесь небольшие и программа могла бы работать на второй версии библиотеки. Поэтому мы можем просто создать символическую ссылку на нее.
Например, библиотеки libusb-1.0.so.1 нет. Но зато есть libusb-1.0.so.0.1, и мы можем ее использовать:
Для этого просто создаем символическую ссылку на библиотеку:
sudo ln -s /usr/lib/libusb-1.0.so.0.1 /usr/lib/libusb-1.0.so.1
В большинстве случаев программа не заметит подмены и будет работать, как и ожидалось. Также для решения этой проблемы можно попытаться найти нужную версию библиотеки в интернете для своей архитектуры и поместить ее в папку /usr/lib/ или /usr/lib64/. Но после этого желательно обновить кэш:
Выводы
В этой статье мы рассмотрели почему возникает ошибка Error while loading shared libraries, а также как ее решить. В большинстве случаев проблема решается довольно просто и вы получите работоспособную программу. Надеюсь, эта информация была полезной для вас.
Источник
Arch Linux
You are not logged in.
#1 2015-08-26 11:35:18
[SOLVED] Darktable: error while loading shared libraries
Hello all!
Starting Darktable shows the following error:
I am aware of the Bugreports regarding a packaging issue in the arch repositories ( https://bugs.archlinux.org/task/44903 ), but I get the error with Darktable from the repositories as well as with my own build from the AUR.
Rebuilding does not help; For some reason, even though ilmbase and openexr 2.2.0-1 are installed on my system, Darktable seems to look for those outdated .so files.
My system is up to date (64bit arch linux) and other Software which depends on ilmbase/openexr, like Gimp or Blender, works for me.
I have tried to remove the whole source/build directory an use the latest pkgbuild as well as to reinstall all dependencies of Darktable, but that didn’t help either.
It would be nice if someone could help me with my problem. Thank you in advance!
Last edited by sunboy (2015-09-01 20:25:41)
#2 2015-08-26 12:47:12
Re: [SOLVED] Darktable: error while loading shared libraries
If rebuilding doesn’t help, darktable itself isn’t the issue. Make sure your entire system is up to date, then look at any other packages you built locally. If you need help finding it, lddtree from pax-utils can help.
#3 2015-08-26 12:53:12
Re: [SOLVED] Darktable: error while loading shared libraries
No problem here.
Is your mirror up-to-date?
Run ‘pacman -Syyu darktable openexr’ and try again.
#4 2015-08-26 14:23:12
Re: [SOLVED] Darktable: error while loading shared libraries
Thank you both,
My mirror is up-to-date. I have rebuilt all locally built packages that are not available in the repositories and replaced the ones that were available by the ones from the repos; Then I have run ‘pacman -Syyu darktable openexr’, but still no luck.
lddtree gives the following output:
According to this the correct Ilm libraries are found, but darktable still doesn’t start with the same error.
#5 2015-08-26 22:34:12
Re: [SOLVED] Darktable: error while loading shared libraries
Hmm, any plugins installed? Maybe set LD_DEBUG=files and see what is happening?
#6 2015-09-01 13:46:39
Re: [SOLVED] Darktable: error while loading shared libraries
There are no plugins installed, starting Darktable with LD_DEBUG=files returns:
#7 2015-09-01 13:55:31
Re: [SOLVED] Darktable: error while loading shared libraries
How about `which darktable`?
#8 2015-09-01 14:29:51
Re: [SOLVED] Darktable: error while loading shared libraries
That returned /usr/local/bin/darktable. There was an old, manually build version installed when the PKGBUILD was out of date for some time. I removed that and now Darktable works. Thank you very much!
#9 2015-09-01 14:53:11
Re: [SOLVED] Darktable: error while loading shared libraries
Please remember to edit your first post and add [SOLVED] to the thread title.
Edit: Although there may not be enough room Do what you can
Last edited by ewaller (2015-09-01 14:53:49)
Nothing is too wonderful to be true, if it be consistent with the laws of nature — Michael Faraday
Sometimes it is the people no one can imagine anything of who do the things no one can imagine. — Alan Turing
—
How to Ask Questions the Smart Way
Источник
Arch Linux
You are not logged in.
#1 2017-05-04 17:20:26
[SOLVED] yaourt libcrypto.so.1.0.0: error
==> Starting package().
node: error while loading shared libraries: libcrypto.so.1.0.0: cannot open shared object file: No such file or directory
==> ERROR: A failure occurred in package().
Aborting.
==> ERROR: Makepkg was unable to build peerflix.
==> Restart building peerflix ? [y/N
PS I have the latest updates openssl 1.1 etc.
Last edited by vitaliy.kuzmich (2017-05-07 09:31:23)
#2 2017-05-04 17:21:58
Re: [SOLVED] yaourt libcrypto.so.1.0.0: error
it seems openssl upgrade, messed up a lot of things.
#3 2017-05-04 17:34:09
Re: [SOLVED] yaourt libcrypto.so.1.0.0: error
By far the most likely problem is that you need to rebuild yaourt against the new openssl.
A few notes for future reference. Please post complete output of commands. Post the output in code tags. When an AUR package fails to build, first try it again with makepkg. Don’t bump your threads (especially with unwarranted accusations).
Mod note: moved to N.C.
EDIT: In hindsight the below is likely right, it may not be yaourt that needs the rebuild — but the rest still applies: it is very hard to interpret partial output.
«UNIX is simple and coherent. » — Dennis Ritchie, «GNU’s Not UNIX» — Richard Stallman
#4 2017-05-04 19:56:22
Re: [SOLVED] yaourt libcrypto.so.1.0.0: error
it seems openssl upgrade, messed up a lot of things.
Looks like you have performed a partial update, or you have installed node in some other way than using the official arch nodejs package.
Edit: yaourt -Syua can easily lead to partial updates, I strongly suggest using pacman -Syu before you use yaourt to try to update the aur packages.
Last edited by Mr.Elendig (2017-05-04 20:01:27)
Evil #archlinux@libera.chat channel op and general support dude.
. files on github, Screenshots, Random pics and the rest
#5 2017-05-05 07:04:39
Re: [SOLVED] yaourt libcrypto.so.1.0.0: error
upd: just rebuild yaourt and package-query, still the same.
Last edited by vitaliy.kuzmich (2017-05-05 07:15:00)
#6 2017-05-05 07:12:47
Re: [SOLVED] yaourt libcrypto.so.1.0.0: error
it seems openssl upgrade, messed up a lot of things.
Looks like you have performed a partial update, or you have installed node in some other way than using the official arch nodejs package.
Edit: yaourt -Syua can easily lead to partial updates, I strongly suggest using pacman -Syu before you use yaourt to try to update the aur packages.
I did run pacman full upgrade before. after I found that file decryption stopped working(https://bbs.archlinux.org/viewtopic.php?id=225863), so I did downgrade pacman and libssl, decrypt files, and after upgrade it again, at the end I run yaourt upgrade and received mentioned errors.
upd: did reinstall npm, but it seems npm issue and not yaourt.
upd: did reinstall nodejs, still does not works
upd: I did install nodejs from official repo for sure.
Last edited by vitaliy.kuzmich (2017-05-05 08:50:47)
#7 2017-05-05 07:12:49
Re: [SOLVED] yaourt libcrypto.so.1.0.0: error
Registered Linux User #482438
#8 2017-05-05 07:39:24
Re: [SOLVED] yaourt libcrypto.so.1.0.0: error
so I did downgrade pacman and libssl
Downgrading just these two packages shouldn’t have been possible because the old openssl would conflict with openssl-1.0. So what exactly did you do to ‘downgrade’?
#9 2017-05-05 08:37:32
Re: [SOLVED] yaourt libcrypto.so.1.0.0: error
so I did downgrade pacman and libssl
Downgrading just these two packages shouldn’t have been possible because the old openssl would conflict with openssl-1.0. So what exactly did you do to ‘downgrade’?
well, I did extract previous versions of .xz pack(openssl), put symlinks instead /usr/lib/libcrypto.so.1.0 and /usr/lib/libssl.so.1.0 (I do not remember which version I put firstly), after downgrade(pacman + openssl), I did drop that links, in order to upgrade to the latests version I did boot from live iso, and install new versions(pacman+openssl) through pacstrap..
upd: pacman works. yaourt also, but node stopped working, which is the reason that it can’t build peerflix
Last edited by vitaliy.kuzmich (2017-05-05 08:47:20)
#10 2017-05-05 10:32:57
Re: [SOLVED] yaourt libcrypto.so.1.0.0: error
Please post the system’s pacman.log along with the output of the following command
Edit:
If node is being provided by some other package than nodejs please provide a pacman -Qi for that package.
If node is not being provided by a package please explain how it was installed.
Last edited by loqs (2017-05-05 11:01:48)
#11 2017-05-05 17:19:34
Re: [SOLVED] yaourt libcrypto.so.1.0.0: error
hmm, I did install peerflix firstly, after I did reinstall node and npm manually a long time ago.
peerflix Qi
Источник