3

Quite often i install software and i have unmet dependencies. A second a go the terminal informed me I lack libglut.so.3 when trying to run molcas gv file.xyz. apt-cache search libglut.so.3 gives no result.

After googling I found that i need to install the freeglut3-dev package. But how can I know what package to install to get a certain library, without searching the internet, preferably from the command line?

I have seen this and this question but I don't see that they would help me here.

2 Answers2

1

As is stated by @edwinksl in comments and by @jbowtie in the second answer to this quite similar question the command line tool is apt-file. In this case the full solution is like:

$ sudo apt install apt-file
$ apt-file update
$ apt-file find libglut.so.3
freeglut3: [... ]
freeglut3-dev: [...]
[...]
$ sudo apt install freeglut3
0

When I come across situations like these while compiling, I usually search it in apt-cache.

For example, if the programs complain about a missing libglut.so.3, I'll remove the lib part and all the extension and search with just glut. Searching this way returned this result

libkwinglutils7 - KDE window manager gl utils library
libkwinglutils6 - KDE window manager gl utils library
libkwinglutils1abi3 - library with OpenGL utilities for the KDE window manager
libkwinactiveglutils1abi3 - library used by accellaration for the KDE window manager Active
freeglut3 - OpenGL Utility Toolkit
python-opengl - Python bindings to OpenGL (Python 2)
libkwinglutils1 - library used by accellaration for the KDE window manager
freeglut3-dbg - OpenGL Utility Toolkit debugging information
freeglut3-dev - OpenGL Utility Toolkit development files
libghc-glut-dev - Haskell GLUT binding for GHC
libghc-glut-doc - Haskell GLUT binding for GHC; documentation
libghc-glut-prof - Haskell GLUT binding for GHC; profiling libraries
libhugs-glut-bundled - A binding for the OpenGL Utility Toolkit
libmgl-glut7.4.0 - library for scientific graphs (glut interface for windows)
libtaoframework-freeglut-cil-dev - Tao CLI binding for freeglut - development files
libtaoframework-freeglut2.4-cil - Tao CLI binding for freeglut
pfsglview - command line HDR manipulation programs (OpenGL/GLUT viewer)
mgltools-mglutil - Molecular Graphics Laboratory utility collection

Now, I'll only consider the packages with -dev suffix, because these are the packages with development libraries. There are only two of them. freeglut3-dev and libghc-glut-dev. I'll go for freeglut3-dev because it seems most relevant.

Anwar
  • 77,855