Hacker Newsnew | past | comments | ask | show | jobs | submitlogin

I've been running pkgng on CURRENT for a bit...It's really quite painless, even if you prefer compiling everything. The new pkg tool does some stuff easily that is painful even in debian (which in my opinion has always done packages right...I was burned by rpms in the 90s/00s many times). For instance I just discovered 'pkg which' which will tell you which package installed any file. I believe this is possible on debian, but not a two word command (I could be wrong).

One benefit as well is that it seems to do less random io/spinlocking when doing stuff with the package database than the old tools, which means large install runs (compiled or not) go much faster.

It also builds in vulnerability auditing, which is also great. Previously this required a separate port.



Just in case you (or anyone else) is wondering. You can find out which rpm installed a file with rpm -qf <file>. And you can see all the files in an installed rpm with rpm -ql <pkg>.

I'm also curious about the dpkg equivalent.


> I'm also curious about the dpkg equivalent.

dpkg -S /path/to/file


dpkg -L <package> lists files in a package.

edit: dpkg -l | --list lists packages, -L|--listfiles lists files in packages (which is why it isn't just dpkg -l)


As already mentioned "dpkg -S file" will show which package installed which file. If you install apt-file, you can also search for which package, installed or not, contains a file:

  $ apt-file search /etc/apache2/ports.conf
  apache2.2-common: /etc/apache2/ports.conf
  $ aptitude search apache2.2-common
  p   apache2.2-common    - Apache HTTP Server common files
  $ dpkg -S /etc/apache2/ports.conf
  dpkg-query: no path found matching pattern
    /etc/apache2/ports.conf


Even the old pkg_info -W offered this.




Guidelines | FAQ | Lists | API | Security | Legal | Apply to YC | Contact

Search: