howtos:apt-file
Differences
This shows you the differences between two versions of the page.
Both sides previous revisionPrevious revision | |||
howtos:apt-file [24/05/2008 18:13] – domingo | howtos:apt-file [02/12/2018 21:34] (current) – external edit 127.0.0.1 | ||
---|---|---|---|
Line 1: | Line 1: | ||
+ | ====== How To Search For Missing Packages With apt-file On Debian and Ubuntu ====== | ||
+ | ===== 1 Initital Situation ===== | ||
+ | |||
+ | I guess you all know this: you try to compile some software from the sources, and suddenly the compilation stops because it complains that some file is missing of which you have never heard before: | ||
+ | |||
+ | // | ||
+ | root@falko-desktop: | ||
+ | make all-recursive \\ | ||
+ | make[1]: Entering directory `/ | ||
+ | Making all in src \\ | ||
+ | make[2]: Entering directory `/ | ||
+ | if gcc -DHAVE_CONFIG_H -I. -I. -I.. -DORBIT2=1 -pthread -I/ | ||
+ | then mv -f " | ||
+ | <color red> | ||
+ | ... \\ | ||
+ | ... \\ | ||
+ | ... \\ | ||
+ | ... \\ | ||
+ | |||
+ | |||
+ | |||
+ | |||
+ | ===== 2 Install apt-file ===== | ||
+ | |||
+ | apt-file is installed as follows: | ||
+ | |||
+ | < | ||
+ | # apt-get install apt-file | ||
+ | </ | ||
+ | |||
+ | After the installation, | ||
+ | |||
+ | < | ||
+ | # apt-file update | ||
+ | </ | ||
+ | |||
+ | You must also do this whenever you modify / | ||
+ | |||
+ | |||
+ | |||
+ | ===== 3 Search For Packages ===== | ||
+ | |||
+ | Now let's search for the package containing the file gtk/gtk.h. You could search like this: | ||
+ | |||
+ | < | ||
+ | # apt-file search gtk.h | ||
+ | </ | ||
+ | |||
+ | but this would give back lots of packages, so let's narrow down the search by running: | ||
+ | |||
+ | < | ||
+ | # apt-file search gtk/gtk.h | ||
+ | </ | ||
+ | |||
+ | The output looks like this: | ||
+ | |||
+ | < | ||
+ | root@falko-desktop: | ||
+ | libgfcui-dev: | ||
+ | libgtk+2.0-directfb-dev: | ||
+ | libgtk1.2-dev: | ||
+ | libgtk2.0-dev: | ||
+ | libgtk2.0-doc: | ||
+ | root@falko-desktop: | ||
+ | </ | ||
+ | |||
+ | As you see there are three packages containing gtk/gtk.h (one contains gtk/gtk.hh, another one gtk/ | ||
+ | |||
+ | < | ||
+ | # apt-get install libgtk2.0-dev | ||
+ | </ | ||
+ | |||
+ | Now we try the compilation again: | ||
+ | |||
+ | < | ||
+ | root@falko-desktop: | ||
+ | make all-recursive | ||
+ | make[1]: Entering directory `/ | ||
+ | Making all in src | ||
+ | make[2]: Entering directory `/ | ||
+ | if gcc -DHAVE_CONFIG_H -I. -I. -I.. -DORBIT2=1 -pthread -I/ | ||
+ | then mv -f " | ||
+ | In file included from / | ||
+ | from main.c:21: | ||
+ | / | ||
+ | / | ||
+ | / | ||
+ | In file included from main.c:28: | ||
+ | awn-app.h: | ||
+ | In file included from main.c:28: | ||
+ | awn-app.h: | ||
+ | awn-app.h: | ||
+ | awn-app.h: | ||
+ | main.c: In function âmainâ: | ||
+ | main.c:52: warning: unused variable âlabâ | ||
+ | make[2]: *** [main.o] Error 1 | ||
+ | make[2]: Leaving directory `/ | ||
+ | make[1]: *** [all-recursive] Error 1 | ||
+ | make[1]: Leaving directory `/ | ||
+ | make: *** [all] Error 2 | ||
+ | root@falko-desktop: | ||
+ | </ | ||
+ | |||
+ | As you see, the initial error is now gone, but still another file is missing, libwnck/ | ||
+ | |||
+ | < | ||
+ | # apt-file search libwnck/ | ||
+ | </ | ||
+ | |||
+ | This time we're lucky, there' | ||
+ | |||
+ | < | ||
+ | root@falko-desktop: | ||
+ | libwnck-dev: | ||
+ | root@falko-desktop: | ||
+ | </ | ||
+ | |||
+ | So let's install the missing package: | ||
+ | |||
+ | < | ||
+ | # apt-get install libwnck-dev | ||
+ | </ | ||
+ | |||
+ | //Source: http:// |