I recently installed java6 on my debian box. I went to use javac and noticed it wasn't installed. Eventually I figured out (after searching online) that javac is part of the java6-sdk package. This isn't the first time where I've know the command I want, but I don't know the package(s) it's in.
My question is- is there a way to on the command line to figure out what file belongs to what package(s)? So if I wanted to see what packages javac belonged to, it would list java6-sdk, java5-sdk, .. since they all contain javac.
You can use apt-file search filename for that. You could just go to Debian Packages and search the online version.
apt-file
is the command you're looking for.I know this isn't exactly what your looking for, but:
dpkg -L packagename
will list all of the files belonging to an installed package. (but you want this for uninstalled packages)
I don't know how it does this, but Ubuntu (derived from Debian) will suggest a package as follows:
And I have often done the obvious, and typed the name of the file, along with "Debian" into google to find the package.
you might also want to look at the dlocate package. it has many useful options for listing packages and files within packages. it was originally written to be a much faster version of dpkg -L, dpkg -S etc but has gained many useful features over the years (while still retaining the speed :)
DISCLAIMER: I'm the author and debian maintainer of dlocate.
BTW, install the version of dlocate from testing or unstable. it has numerous improvements over the version in stable (in particular, it doesn't depend on GNU locate any more) and still works fine in stable (doesn't depend on any new/updated libs etc).