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.

5
  • 3
    Use apt-file or packages.ubuntu.com. These are mentioned in the first link you gave.
    – edwinksl
    Aug 26, 2016 at 11:57
  • The second answer about apt-file in that link is definitely the right answer, but i didn't realize it! On the other hand, that question asks about a 'file' and only the bonus question relates to my issue. Also, it seems like many questions similar to mine have been closed due to similarity with that question. But at first sight, they aren't very similar, so I and other people get confused by this. Aug 26, 2016 at 12:08
  • 1
    Using goggle. It IS the best finding the solution. apt-file is slow and depends on pre-existing data.
    – Anwar
    Aug 26, 2016 at 20:53
  • Haha I'm slow. I was all "what's goggle?" apt-file and googling are the best options but @Anwar is right. apt-file is slow and depends on pre-existing data.
    – James
    Aug 26, 2016 at 20:54
  • Installing and updating was slow indeed, but searching was just a couple of seconds. Anyway it's comforting just to know that there is a reliable system for doing this! Aug 26, 2016 at 21:10

2 Answers 2

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.

Not the answer you're looking for? Browse other questions tagged .