How to find which package a missing file comes from with YUM or PackageKit

Posted in Linux , howto , simple

I go to build some code on a new system, but oops, there’s a bunch of errors in compiling and it’s complaining about missing files. The problem is not in the code, it’s just that this system is missing some packages required to build the code. But you can find out pretty quickly if there are standard packages available in the software repositories that supply the missing files.

I go to build the code… a few clicks later and oohhh noooos. “No such file or directory”

$ make


-O2 -MT xed-main.o -MF .deps/xed-main.Tpo -c -o xed-main.o `test -f ‘main.cc’ || echo ‘./’`main.cc
In file included from /usr/include/sigc++-2.0/sigc++/signal.h:8,
from /usr/include/sigc++-2.0/sigc++/sigc++.h:23,
from /usr/include/glibmm-2.4/glibmm/signalproxy.h:13,
from /usr/include/glibmm-2.4/glibmm/objectbase.h:24,
from /usr/include/glibmm-2.4/glibmm/wrap.h:26,
from /usr/include/glibmm-2.4/glibmm/containerhandle_shared.h:35,
from /usr/include/glibmm-2.4/glibmm/arrayhandle.h:24,
from /usr/include/glibmm-2.4/glibmm.h:27,
from /usr/include/libgnomeuimm-2.6/libgnomeuimm/about.h:7,
from main.cc:5:
/usr/include/sigc++-2.0/sigc++/signal_base.h:25:26: error: sigc++config.h: No such file or directory

Find the package(s) missing using YUM. It’s as easy as asking it what provides the missing files. In this case I can see from the last line which file it’s looking for but can’t find. Cut and paste the full path to the file and use it as the argument to “sudo yum whatprovides”, and it will tell you which packages include that file.

$ sudo yum whatprovides /usr/include/sigc++-2.0/sigc++/signal_base.h

Loading “changelog” plugin
Loading “downloadonly” plugin
Importing additional filelist information
libsigc++20-devel.x86_64 : Development tools for the typesafe signal framework for C++
libsigc++20-devel.i386 : Development tools for the typesafe signal framework for C++
libsigc++20-devel.x86_64 : Development tools for the typesafe signal framework for C++
libsigc++20-devel.x86_64 : Development tools for the typesafe signal framework for C++

I have libsigc++20-devel installed, but I only have the x86_64 version. I happen to be trying to compile some 32 bit code (-m32 flag) on a system running an x86_64 distribution, so I just need the right devel package installed. I’ll see this as soon as I go to install libsigc++20-devel. It says I already have one installed, but i’m missing the other.

$ sudo yum install libsigc++20-devel

Loading “changelog” plugin
Loading “downloadonly” plugin
Setting up Install Process
Parsing package install arguments
Package libsigc++20-devel - 2.0.18-1.x86_64 is already installed.
Package libsigc++20-devel - 2.0.18-1.x86_64 is already installed.
Resolving Dependencies
–> Running transaction check
—> Package libsigc++20-devel.i386 0:2.0.18-1 set to be updated
–> Finished Dependency Resolution

There you. It was broken and now it’s fixed.

broke-leg-kitten-fixed

Now I run make, and if I have any more missing file errors, I’ll repeat the process until I can build the code without problems.

If you’re using Fedora, the new PackageKit (which is probably already installed by default) has a command line interface that also gives you a “what-provides” interface in addition to a bunch of other features.

$ pkcon –help

Usage:
pkcon [OPTION...] PackageKit Console Program

PackageKit Console Interface

Subcommands:
get-actions
get-groups
get-filters
get-transactions
get-time
search [name|details|group|file] [data]
install [packages|files]
download [directory] [packages]
remove [package]
update refresh
resolve [package]
get-updates
get-depends [package]
get-requires [package]
get-details [package]
get-distro-upgrades
get-files [package]
get-update-detail [package]
get-packages
repo-list
repo-enable [repo_id]
repo-disable [repo_id]
repo-set-data [repo_id] [parameter] [value];
what-provides [search]
get-categories

Posted by admica   @   12 November 2009

Related Posts

0 Comments

No comments yet. Be the first to leave a comment !
Leave a Comment

Name

Email

Website

Previous Post
« I always find it sad to reboot a Linux server
Next Post
Install Google’s “Go” Programming Language on Fedora 12 or 11 »
Powered by Wordpress   |   Lunated designed by ZenVerse