Author Topic: Installing from source?.. failed to build because something is missing? [Ubuntu]  (Read 4590 times)

0 Members and 1 Guest are viewing this topic.

Offline Mark Greaves (PCNetSpec)

  • Administrator
  • Hero Member
  • *****
  • Posts: 18231
  • Karma: 476
  • Gender: Male
  • "-rw-rw-rw-" .. The Number Of The Beast
    • View Profile
    • PCNetSpec
    • Awards
Installing from source?... failed to build because something is missing?

There is a tool (part of the apt group of tools) called apt-file that helps you find which package contains the missing file.

I was recently trying to install k3b 2.0.0 (from source files, as it isn't available in the repos yet), the build failed... part of the output was:
Quote
CMake Error at /usr/share/cmake-2.8/Modules/FindKDE4.cmake:98 (MESSAGE):
  ERROR: cmake/modules/FindKDE4Internal.cmake not found in
  /home/mark/.kde/share/apps;/usr/share/kde4/apps


I wondered how was the best way get the FindKDE4Internal.cmake file and install it.

The answer was to install apt-file:
Code: [Select]
sudo apt-get install apt-file
update its cache:
Code: [Select]
apt-file update
then search for the package that contains FindKDE4Internal.cmake:
Code: [Select]
apt-file search FindKDE4Internal.cmake

Apt-find output a single line:
Quote
kdelibs5-dev: /usr/share/kde4/apps/cmake/modules/FindKDE4Internal.cmake

(this tells you which package contains the file, and the path where it will be installed)

So the kdelibs5-dev package contained the file I needed... I installed it:
Code: [Select]
sudo apt-get install kdelibs5-dev
And the k3b 2.0.0 source files built properly.

When building from source, this is a VERY handy tool for finding missing files.

HINT: Install apt-file from the command line (not synaptic), then update its cache (again from the command line)... when I tried to install it from synaptic, it attempted to update its cache and failed with a message about not being able to start a child process.

Credit must go to this article:
http://www.linuxjournal.com/content/apt-file-locate-missing-package-files
« Last Edit: August 20, 2010, 05:12:53 am by Mark Greaves (PCNetSpec) »
WARNING: You are logged into reality as 'root'
logging in as 'insane' is the only safe option.
pcnetspec.co.uk

Offline Mad Penguin

  • Administrator
  • Hero Member
  • *****
  • Posts: 1420
  • Karma: 10018
  • Gender: Male
    • View Profile
    • Linux in the UK
    • Awards
If you find something that IS in the repos but horribly out of date (Ubuntu tend to be a year or two behind on stuff I want to use) there is another apt variant which is also very useful. Once you have acquired your source package, do;

Quote
apt-get build-dep <ubuntu package name>

This will acquire all the dependant packages and libraries used to build the version of the package currently available, and whereas a newer version of the source code may well require some new libraries, this command will generally obtain most of the packages you need leaving one or two over for apt-file.

 


SimplePortal 2.3.3 © 2008-2010, SimplePortal