LinuxQuestions.org
Share your knowledge at the LQ Wiki.
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Distributions > Debian
User Name
Password
Debian This forum is for the discussion of Debian Linux.

Notices


Reply
  Search this Thread
Old 02-15-2010, 05:27 PM   #1
BrianK
Senior Member
 
Registered: Mar 2002
Location: Los Angeles, CA
Distribution: Debian, Ubuntu
Posts: 1,334

Rep: Reputation: 51
I know what file I need, I don't know what package installs it. How to find out?


I need a particular include file. I know the file name. I don't know which package would install it.

apt-cache seems to only search names and descriptions.

dpkg -S seems to only search through installed packages.

I need to find a package that's not yet installed. I probably just missed the option in the man page... or I don't know which program to man.

Ideas?

Thanks.
 
Old 02-15-2010, 05:32 PM   #2
repo
LQ 5k Club
 
Registered: May 2001
Location: Belgium
Distribution: Arch
Posts: 8,528

Rep: Reputation: 899Reputation: 899Reputation: 899Reputation: 899Reputation: 899Reputation: 899Reputation: 899
Take a look at apt-file
http://www.debuntu.org/how-to-find-m...-with-apt-file
 
Old 02-15-2010, 05:45 PM   #3
BrianK
Senior Member
 
Registered: Mar 2002
Location: Los Angeles, CA
Distribution: Debian, Ubuntu
Posts: 1,334

Original Poster
Rep: Reputation: 51
Quote:
Originally Posted by repo View Post
That's what I was looking for. Thanks!
 
Old 02-15-2010, 11:18 PM   #4
lugoteehalt
Senior Member
 
Registered: Sep 2003
Location: UK
Distribution: Debian
Posts: 1,215
Blog Entries: 2

Rep: Reputation: 49
Quote:
Originally Posted by repo View Post
Sounds extremely useful, so installed it but when trying to update its cache got troubles:
Code:
Setting up apt-file (2.1.5) ...
You need to run 'apt-file update' as root to update the cache.
fido:/home/lugo# apt-file update
Can't get http://www.debian-desktop.org/pub/linux/debian/kde43/dists/lenny-backports/Contents-amd64.gz
Can't get http://non-us.debian.org/debian-non-US/dists/stable/non-US/Contents-amd64.gz
Can't get http://security.debian.org/dists/stable/updates/Contents-amd64.gz
Put CDROM labeled [Debian_GNU/Linux_5.0.0__Lenny__-_Official_amd64_CD_Binary-4_20090214-19:11] in the cdrom device

mount: block device /dev/sr0 is write-protected, mounting read-only
cp: cannot stat `/cdrom/dists/lenny/Contents-amd64.gz': No such file or directory
Put CDROM labeled [Debian_GNU/Linux_5.0.0__Lenny__-_Official_amd64_CD_Binary-3_20090214-19:11] in the cdrom device
Any suggestions, apart from "Why don't you kill yourself we'll understand?"
 
Old 02-16-2010, 03:07 PM   #5
BrianK
Senior Member
 
Registered: Mar 2002
Location: Los Angeles, CA
Distribution: Debian, Ubuntu
Posts: 1,334

Original Poster
Rep: Reputation: 51
Quote:
Originally Posted by lugoteehalt View Post
Sounds extremely useful, so installed it but when trying to update its cache got troubles:
Code:
Setting up apt-file (2.1.5) ...
You need to run 'apt-file update' as root to update the cache.
fido:/home/lugo# apt-file update
Can't get http://www.debian-desktop.org/pub/linux/debian/kde43/dists/lenny-backports/Contents-amd64.gz
Can't get http://non-us.debian.org/debian-non-US/dists/stable/non-US/Contents-amd64.gz
Can't get http://security.debian.org/dists/stable/updates/Contents-amd64.gz
Put CDROM labeled [Debian_GNU/Linux_5.0.0__Lenny__-_Official_amd64_CD_Binary-4_20090214-19:11] in the cdrom device

mount: block device /dev/sr0 is write-protected, mounting read-only
cp: cannot stat `/cdrom/dists/lenny/Contents-amd64.gz': No such file or directory
Put CDROM labeled [Debian_GNU/Linux_5.0.0__Lenny__-_Official_amd64_CD_Binary-3_20090214-19:11] in the cdrom device
Any suggestions, apart from "Why don't you kill yourself we'll understand?"
Looks like your apt sources are still pointing at a CDROM? You should probably update /etc/apt/sources.list to remove the CD & add the debian repos. (I find this to be a bit easier via the "Synaptic" GUI, under the Settings pull-down, then Repositories).

Then you'll need to run "sudo apt-get update".

also, you probably need to run apt-file update as sudo as well... "sudo apt-file update" (assuming you weren't running as root)
 
Old 02-16-2010, 03:17 PM   #6
jim_p
Member
 
Registered: Aug 2009
Distribution: Debian testing
Posts: 556

Rep: Reputation: 127Reputation: 127
You can also use the 2nd search box in packages.debian.org.
I think "apt-file update" takes ages to do its update, so I removed it.
 
Old 02-16-2010, 03:45 PM   #7
AlucardZero
Senior Member
 
Registered: May 2006
Location: USA
Distribution: Debian
Posts: 4,824

Rep: Reputation: 615Reputation: 615Reputation: 615Reputation: 615Reputation: 615Reputation: 615
If apt-file isn't working out, use http://www.debian.org/distrib/packages#search_contents
 
Old 02-16-2010, 05:34 PM   #8
lugoteehalt
Senior Member
 
Registered: Sep 2003
Location: UK
Distribution: Debian
Posts: 1,215
Blog Entries: 2

Rep: Reputation: 49
Quote:
Originally Posted by jim_p View Post
You can also use the 2nd search box in packages.debian.org.
I think "apt-file update" takes ages to do its update, so I removed it.
Thanks all. I'll just do that then, it's what I did already had not worked out it was the same as apt-file.
 
Old 02-16-2010, 08:04 PM   #9
craigevil
Senior Member
 
Registered: Apr 2005
Location: OZ
Distribution: Debian Sid
Posts: 4,734
Blog Entries: 12

Rep: Reputation: 462Reputation: 462Reputation: 462Reputation: 462Reputation: 462
Quote:
Originally Posted by jim_p View Post
You can also use the 2nd search box in packages.debian.org.
I think "apt-file update" takes ages to do its update, so I removed it.
39 seconds is forever?

Code:
$ apt-file update
Downloading Index http://ftp.debian.org/debian/dists/sid/Contents-i386.diff/Index:
  % Total    % Received % Xferd  Average Speed   Time    Time     Time  Current
                                 Dload  Upload   Total   Spent    Left  Speed
102  2053  102  2053    0     0   5979      0 --:--:-- --:--:-- --:--:-- 12147
local file too old
Downloading complete file http://ftp.debian.org/debian/dists/sid/Contents-i386.gz
  % Total    % Received % Xferd  Average Speed   Time    Time     Time  Current
                                 Dload  Upload   Total   Spent    Left  Speed
100 16.8M  100 16.8M    0     0   446k      0  0:00:38  0:00:38 --:--:--  598k
Downloading complete file http://sidux.net/debian/dists/sid/Contents-i386.gz
  % Total    % Received % Xferd  Average Speed   Time    Time     Time  Current
                                 Dload  Upload   Total   Spent    Left  Speed
100  358k  100  358k    0     0   231k      0  0:00:01  0:00:01 --:--:--  261k
Downloading Index http://www.debian-multimedia.org/dists/unstable/Contents-i386.diff/Index:
  % Total    % Received % Xferd  Average Speed   Time    Time     Time  Current
                                 Dload  Upload   Total   Spent    Left  Speed
101  2023  101  2023    0     0   6757      0 --:--:-- --:--:-- --:--:-- 15325
Calculating old sha1sum...
local file too old
Downloading complete file http://www.debian-multimedia.org/dists/unstable/Contents-i386.gz
  % Total    % Received % Xferd  Average Speed   Time    Time     Time  Current
                                 Dload  Upload   Total   Spent    Left  Speed
100  107k  100  107k    0     0   124k      0 --:--:-- --:--:-- --:--:--  153k
Ignoring source without Contents File:
  http://liquorix.net/debian/dists/sid/Contents-i386.gz
Ignoring source without Contents File:
  http://dl.google.com/linux/deb/dists/stable/Contents-i386.gz
Ignoring source without Contents File:
  http://dl.google.com/linux/deb/dists/testing/Contents-i386.gz
apt-file search works great.
 
Old 02-17-2010, 02:00 AM   #10
jim_p
Member
 
Registered: Aug 2009
Distribution: Debian testing
Posts: 556

Rep: Reputation: 127Reputation: 127
The very first time I ran "apt-file update" on my k3000+, 512MB of ram and a 2Mbps internet connection took ~30 minutes to do its job. I have no idea where does it retrieve its info though.
 
Old 02-17-2010, 03:07 PM   #11
BrianK
Senior Member
 
Registered: Mar 2002
Location: Los Angeles, CA
Distribution: Debian, Ubuntu
Posts: 1,334

Original Poster
Rep: Reputation: 51
Quote:
Originally Posted by jim_p View Post
The very first time I ran "apt-file update" on my k3000+, 512MB of ram and a 2Mbps internet connection took ~30 minutes to do its job. I have no idea where does it retrieve its info though.
fwiw, it took less than a minute for me as well.

That said, most of my repo is on the local network.
 
  


Reply


Thread Tools Search this Thread
Search this Thread:

Advanced Search

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off



Similar Threads
Thread Thread Starter Forum Replies Last Post
Need help with package installs Bodrey Linux - Newbie 3 12-19-2009 11:47 PM
[SOLVED] How to find out which package needed for a particular file? catkin Slackware 3 10-07-2009 08:49 AM
Which package installs what RPMS? unixgoose Fedora 3 05-25-2006 08:52 AM
Command to find out which package contains which file ? javeree Slackware 6 07-10-2004 07:35 PM
package installs... mathfeel Fedora 4 12-01-2003 06:06 AM

LinuxQuestions.org > Forums > Linux Forums > Linux - Distributions > Debian

All times are GMT -5. The time now is 05:24 PM.

Main Menu
Advertisement
My LQ
Write for LQ
LinuxQuestions.org is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
Syndicate
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
Facebook: linuxquestions Google+: linuxquestions
Open Source Consulting | Domain Registration