Error While Loading Shared Libraries (libGLU.so.1)

I am trying to run Chamsys MagicQ on Ubuntu 12.10 with 64bit AMD processor.
This is what it tells me when I try to run the program.

./magicq: error while loading shared libraries: libGLU.so.1: cannot open shared object >file: No such file or directory

Here is the list of library dependencies for MagicQ:

austin@ubuntu:~/magicq$ ldd ./magicq
linux-gate.so.1 => (0xf7799000)
libGLU.so.1 => not found
libusb-0.1.so.4 => not found
libQt5PrintSupport.so.5 => not found
libQt5OpenGL.so.5 => not found
libQt5Widgets.so.5 => not found
libQt5Network.so.5 => not found
libQt5Gui.so.5 => not found
libQt5Core.so.5 => not found
libGL.so.1 => /usr/lib32/fglrx/libGL.so.1 (0xf7694000)
libpthread.so.0 => /lib/i386-linux-gnu/libpthread.so.0 (0xf7679000)
libstdc++.so.6 => not found
libm.so.6 => /lib/i386-linux-gnu/libm.so.6 (0xf764d000)
libgcc_s.so.1 => /lib/i386-linux-gnu/libgcc_s.so.1 (0xf762e000)
libc.so.6 => /lib/i386-linux-gnu/libc.so.6 (0xf7483000)
libXext.so.6 => not found
libatiuki.so.1 => /usr/lib32/fglrx/libatiuki.so.1 (0xf746c000)
libdl.so.2 => /lib/i386-linux-gnu/libdl.so.2 (0xf7467000)
/lib/ld-linux.so.2 (0xf779a000)

I know libGLU.so.1 is in /usr/lib/x86_64-linux-gnu as a "link to shared library (application/x-sharedlib)" Link target: "libGLU.so.1.3.1" How do I fix this?


Solution 1:

Actually I couldn't find libglu package itself. What helped is:

sudo apt-get install libglu1-mesa:i386

Ubuntu 14.04 x64

Solution 2:

I just needed to install this, without any 32-bit or 64-bit reference.

sudo apt-get install libglu1

Solution 3:

I figured it out. I had to install the 32-bit versions.

For anyone else who may have the same problem and is running a 64-bit operating system. Find the packages that include the missing files and use:

sudo apt-get install package:i386

Change "package" to the name of the package. Without the ":i386" it will install the 64 bit version only.

Solution 4:

In case anyone is reading this using Ubuntu 18.04, here's one way to search for the package to install. I got this error when trying to run Blender on a new Ubuntu 18.04 machine from a cloud computing instance. Here was the error, where I try to check if Blender 2.82a is installed correctly by printing out the version:

user@init-blender-test:~/blender-2.82a-linux64$ ./blender --version
./blender: error while loading shared libraries: libGL.so.1: cannot open shared object file: No such file or directory

To find the package to install, I did an apt-file search:

user@init-blender-test:~/blender-2.82a-linux64$ apt-file search libGL.so.1
libgl1: /usr/lib/x86_64-linux-gnu/libGL.so.1
libgl1: /usr/lib/x86_64-linux-gnu/libGL.so.1.0.0
nvidia-340: /usr/lib/i386-linux-gnu/libGL.so.1
nvidia-340: /usr/lib/x86_64-linux-gnu/libGL.so.1
primus-libs: /usr/lib/x86_64-linux-gnu/primus/libGL.so.1
virtualbox-guest-x11: /usr/lib/virtualbox/additions/libGL.so.1
virtualbox-guest-x11-hwe: /usr/lib/virtualbox/additions/libGL.so.1

See this StackOverflow answer for more details. If apt-file isn't found, you may need to install it with sudo apt install apt-file.

Therefore, from the above, I see that sudo apt install libgl1 can be used, and it fixed my error. Note that there are multiple packages that reference the missing file (nvidia-340, etc.) so you'll have to judge and test for yourself on a case-by-case basis.