Error while loading shared libraries libxt so 6

Starting binary -> can't open shared library I want to start a binary: $ my@mypc:~/Machinarium$ ./Machinarium ./Machinarium: error while loading shared libraries: libXt.so.6: cannot open shared ...

Starting binary -> can’t open shared library

I want to start a binary:

$ my@mypc:~/Machinarium$ ./Machinarium
./Machinarium: error while loading shared libraries: libXt.so.6: cannot open shared object file: No such file or directory

here

(Same happens when I try to start it via linux32 ./Machinarium. It is a 32bit linux binary and I have a 64bit machine. Same with sudo.)


Locating the library (it exists)

I tried to locate it: (fourth line from the bottom is the important one)

me@mypc:~/Machinarium$ locate libXt
/home/me/.local/share/Steam/ubuntu12_32/steam-runtime/amd64/usr/lib/x86_64-linux-gnu/libXt.so.6
/home/me/.local/share/Steam/ubuntu12_32/steam-runtime/amd64/usr/lib/x86_64-linux-gnu/libXt.so.6.0.0
/home/me/.local/share/Steam/ubuntu12_32/steam-runtime/amd64/usr/lib/x86_64-linux-gnu/libXtst.so.6
/home/me/.local/share/Steam/ubuntu12_32/steam-runtime/amd64/usr/lib/x86_64-linux-gnu/libXtst.so.6.1.0
/home/me/.local/share/Steam/ubuntu12_32/steam-runtime/i386/usr/lib/i386-linux-gnu/libXt.so.6
/home/me/.local/share/Steam/ubuntu12_32/steam-runtime/i386/usr/lib/i386-linux-gnu/libXt.so.6.0.0
/home/me/.local/share/Steam/ubuntu12_32/steam-runtime/i386/usr/lib/i386-linux-gnu/libXtst.so.6
/home/me/.local/share/Steam/ubuntu12_32/steam-runtime/i386/usr/lib/i386-linux-gnu/libXtst.so.6.1.0
/home/me/.local/share/Steam/ubuntu12_32/steam-runtime.old/amd64/usr/lib/x86_64-linux-gnu/libXt.so.6
/home/me/.local/share/Steam/ubuntu12_32/steam-runtime.old/amd64/usr/lib/x86_64-linux-gnu/libXt.so.6.0.0
/home/me/.local/share/Steam/ubuntu12_32/steam-runtime.old/amd64/usr/lib/x86_64-linux-gnu/libXtst.so.6
/home/me/.local/share/Steam/ubuntu12_32/steam-runtime.old/amd64/usr/lib/x86_64-linux-gnu/libXtst.so.6.1.0
/home/me/.local/share/Steam/ubuntu12_32/steam-runtime.old/i386/usr/lib/i386-linux-gnu/libXt.so.6
/home/me/.local/share/Steam/ubuntu12_32/steam-runtime.old/i386/usr/lib/i386-linux-gnu/libXt.so.6.0.0
/home/me/.local/share/Steam/ubuntu12_32/steam-runtime.old/i386/usr/lib/i386-linux-gnu/libXtst.so.6
/home/me/.local/share/Steam/ubuntu12_32/steam-runtime.old/i386/usr/lib/i386-linux-gnu/libXtst.so.6.1.0
/usr/lib/x86_64-linux-gnu/libXt.a
/usr/lib/x86_64-linux-gnu/libXt.so
/usr/lib/x86_64-linux-gnu/libXt.so.6
/usr/lib/x86_64-linux-gnu/libXt.so.6.0.0
/usr/lib/x86_64-linux-gnu/libXtst.so.6
/usr/lib/x86_64-linux-gnu/libXtst.so.6.1.0

So what happened? It’s clearly there. Why can’t it be found?


Install i386 version explicitly

I thought since it’s a folder labeled x86_64 this might not be compatible to that 32bit game. So I installed the 32bit version explicitly. (Following that stackoverflow answer.)

me@mypc:~/Machinarium$ sudo apt install libxtst6:i386
libxtst6:i386 already is the newest version (2:1.2.3-1).

(translation by me. This is one line of what the very short answer by apt says.)


Requirements check -> not found

I checked the requirements for the binary: (I only give you the important line of the output and ignore any other line, if you really need the rest I wonder what for, just tell me in the comments if needed!)

me@mypc:~/Machinarium$ ldd Machinarium
libXt.so.6 => not found

Question

  • Why doesn’t the binary find the shared library?
  • How to fix that?
  • Index
  • » Applications & Desktop Environments
  • » libXt.so.6 cannot open shared object file: No such file or directory

Pages: 1

#1 2011-03-12 06:19:19

turingcat
Member
Registered: 2008-08-14
Posts: 18

libXt.so.6 cannot open shared object file: No such file or directory

I try to install slickedit on my 64bit archlinux, and when I execute the vsinit cmd to install it, error happen:

./vsinst: error while loading shared libraries: libXt.so.6: cannot open shared object file: No such file or directory

But I found the libXt.so.6 at my /usr/lib/ like:

[root@turingcat-work se_15000103_linux_full]# ls /usr/lib/libXt* -la
lrwxrwxrwx 1 root root     14  3月 11 2011 /usr/lib/libXt.so -> libXt.so.6.0.0
lrwxrwxrwx 1 root root     14  3月 11 2011 /usr/lib/libXt.so.6 -> libXt.so.6.0.0
-rwxr-xr-x 1 root root 412208 11月  2 06:15 /usr/lib/libXt.so.6.0.0
lrwxrwxrwx 1 root root     16  3月 11 2011 /usr/lib/libXtst.so -> libXtst.so.6.1.0
lrwxrwxrwx 1 root root     16  3月 11 2011 /usr/lib/libXtst.so.6 -> libXtst.so.6.1.0
-rwxr-xr-x 1 root root  23344 10月 31 23:56 /usr/lib/libXtst.so.6.1.0

so the file exist. anyone can help me?

thanks a lot.

#2 2011-03-12 10:46:20

nTia89
Banned
From: varese, italy
Registered: 2008-12-22
Posts: 1,230

Re: libXt.so.6 cannot open shared object file: No such file or directory

probably program search in the wrong place ….


+pc: custom | AMD Opteron 175 | nForce4 Ultra | 2GB ram DDR400 | nVidia 9800GT 1GB | ArchLinux x86_64 w/ openbox
+laptop: Apple | MacBook (2,1) | 2GB ram | Mac OS X 10.4 -> DIED
+ultrabook: Dell | XPS 13 (9343) | 8GB ram | 256GB ssd | FullHD display | Windows 8.1 64bit ArchLinux x86_64 w/ Gnome

#3 2011-03-12 13:43:50

Mr.Elendig
#archlinux@freenode channel op
From: The intertubes
Registered: 2004-11-07
Posts: 4,082

Re: libXt.so.6 cannot open shared object file: No such file or directory

Let me guess, slickedit is a binary only closed source app, and only ships 32bit binaries?


Evil #archlinux@libera.chat channel op and general support dude.
. files on github, Screenshots, Random pics and the rest

#4 2011-03-13 13:33:06

turingcat
Member
Registered: 2008-08-14
Posts: 18

Re: libXt.so.6 cannot open shared object file: No such file or directory

Mr.Elendig wrote:

Let me guess, slickedit is a binary only closed source app, and only ships 32bit binaries?

yes, it is a binary and I can not find 64bit for it. I think is most powerful tools I need to write and analyse code, just like sourceinsight at windows.
Maybe it can not find the lib at /usr/lib32.

#5 2011-03-13 13:56:26

Mr.Elendig
#archlinux@freenode channel op
From: The intertubes
Registered: 2004-11-07
Posts: 4,082

Re: libXt.so.6 cannot open shared object file: No such file or directory

pacman -Q lib32-libxt  if you don’t have it, pacman -Syu lib32-libxt


Evil #archlinux@libera.chat channel op and general support dude.
. files on github, Screenshots, Random pics and the rest

#6 2011-03-14 01:12:08

turingcat
Member
Registered: 2008-08-14
Posts: 18

Re: libXt.so.6 cannot open shared object file: No such file or directory

I add the mutlilib and install lib32-libxt,it works well. Thanks all.

Новые и опытные пользователи 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. Если библиотека установлена в другой каталог, то, возможно, это и есть причина проблемы.

Вы можете посмотреть какие библиотеки сейчас доступны загрузчику с помощью команды:

ldconfig -p

Найти, где находится ваша библиотека можно с помощью команды locate. Например, нас интересует библиотека librtfreader.so:

 locate librtfreader

Теперь мы знаем, что она находится по адресу /opt/kingsoft/wps-office/office6/. А значит, для работы программы необходимо сделать чтобы загрузчик библиотек ее видел. Для этого можно добавить путь в один из файлов /etc/ld.so.conf.d/ или же в переменную LD_LIBRARY_PATH:

export LD_LIBRARY_PATH=/opt/kingsoft/wps-office/office6/

Опять же, так вы можете поставить с любой библиотекой, которая взывает ошибку. Еще один более простой метод — это просто создать символическую ссылку на нужную библиотеку в правильной папке:

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/. Но после этого желательно обновить кэш:

sudo ldconfig

Выводы

В этой статье мы рассмотрели почему возникает ошибка Error while loading shared libraries, а также как ее решить. В большинстве случаев проблема решается довольно просто и вы получите работоспособную программу. Надеюсь, эта информация была полезной для вас.

Creative Commons License

Статья распространяется под лицензией Creative Commons ShareAlike 4.0 при копировании материала ссылка на источник обязательна .

The «libXtst.so.6 cannot open shared object file» is quite common if you install any oracle product on 64bit system and misses something in the system
prerequisites. A quick resolution is installing the  libXtst package for both 32 bit and 64 bit. But, last time while installing OID on 64bit Linux, I found that though libXtst package is already there, still this error is coming. See the error below and its solution.




The following error is coming during starting of installer.


$ ./runInstaller -ignoreSysPrereqs


——————————————————————————————————————-
The OUI Screen may take around 5 to 30 seconds to come up depending upon system performance. Please Wait …….
——————————————————————————————————————-


Starting Oracle Universal Installer…


Checking installer requirements…


Checking operating system version: must be redhat-Red Hat Enterprise Linux AS release 4, redhat-2.1, redhat-3, SuSE-9 or UnitedLinux-1.0
                                      Failed <<<<




>>> Ignoring required pre-requisite failures. Continuing…


Preparing to launch Oracle Universal Installer from /tmp/OraInstall2013-02-11_01-46-40PM. Please wait …[xxxxxx@Disk1]$ Oracle Universal Installer, Version 10.1.0.5.0 Production
Copyright (C) 1999, 2006, Oracle. All rights reserved.


Exception java.lang.UnsatisfiedLinkError: /tmp/OraInstall2013-02-11_01-46-40PM/jre/1.4.2/lib/i386/libawt.so: libXtst.so.6: cannot open shared object file: No such file or directory occurred..
java.lang.UnsatisfiedLinkError: /tmp/OraInstall2013-02-11_01-46-40PM/jre/1.4.2/lib/i386/libawt.so: libXtst.so.6: cannot open shared object file: No such file or directory
        at java.lang.ClassLoader$NativeLibrary.load(Native Method)
        at java.lang.ClassLoader.loadLibrary0(ClassLoader.java:1560)
        at java.lang.ClassLoader.loadLibrary(ClassLoader.java:1477)
        at java.lang.Runtime.loadLibrary0(Runtime.java:788)
        at java.lang.System.loadLibrary(System.java:834)
        at sun.security.action.LoadLibraryAction.run(LoadLibraryAction.java:50)
        at java.security.AccessController.doPrivileged(Native Method)
        at sun.awt.NativeLibLoader.loadLibraries(NativeLibLoader.java:38)


Solution


Although the following command is showing that libXtst package is installed for both 32bit and 64bit.
#  rpm -q —qf ‘%{NAME}-%{VERSION}-%{RELEASE} (%{ARCH})
libXt-1.0.2-3.2.el5 (x86_64)
libXt-1.0.2-3.2.el5 (i386)


But oracle installer is trying to get file libXtst.so.6 from /usr/lib/libXtst.so.6 where libXtst.so.6 file doesn’t exist. The 32bit version of the file is in /usr/X11R6/lib/libXtst.so.6 location.


So, I have created a softlink using following command and restarted the installation.
ln -s /usr/X11R6/lib/libXtst.so.6 /usr/lib/libXtst.so.6

Понравилась статья? Поделить с друзьями:
  • Error while loading shared libraries libxrender so 1
  • Error while loading shared libraries libxcb xinerama so 0
  • Error while loading shared libraries libx11 so 6
  • Error while loading shared libraries libwine so 1
  • Error while loading shared libraries libwbclient so 0