💾 Archived View for perso.pw › blog › articles › pkglocate-openbsd.gmi captured on 2024-06-16 at 12:39:51. Gemini links have been rewritten to link to archived content

View Raw

More Information

⬅️ Previous capture (2023-05-24)

-=-=-=-=-=-=-

Find which package provides a given file in OpenBSD

Comment on Mastodon

There is one very handy package on OpenBSD named `pkglocatedb`

which provides the command `pkglocate`.

If you need to find a file or binary/program and you don't know

which package contains it, use pkglocate.

$ pkglocate */bin/exiftool

p5-Image-ExifTool-12.00:graphics/p5-Image-ExifTool:/usr/local/bin/exiftool

With the result, I know that the package `p5-Image-ExifTool` will provide me

the command `exiftool`.

Another example looking for files containing the pattern "libc++"

$ pkglocate libc++

base67:/usr/lib/libc++.so.5.0

base67:/usr/lib/libc++abi.so.3.0

comp67:/usr/lib/libc++.a

comp67:/usr/lib/libc++_p.a

comp67:/usr/lib/libc++abi.a

comp67:/usr/lib/libc++abi_p.a

qt4-4.8.7p23:x11/qt4,-main:/usr/local/lib/qt4/mkspecs/unsupported/macx-clang-libc++/

qt4-4.8.7p23:x11/qt4,-main:/usr/local/lib/qt4/mkspecs/unsupported/macx-clang-libc++/Info.plist.app

qt4-4.8.7p23:x11/qt4,-main:/usr/local/lib/qt4/mkspecs/unsupported/macx-clang-libc++/Info.plist.lib

qt4-4.8.7p23:x11/qt4,-main:/usr/local/lib/qt4/mkspecs/unsupported/macx-clang-libc++/qmake.conf

qt4-4.8.7p23:x11/qt4,-main:/usr/local/lib/qt4/mkspecs/unsupported/macx-clang-libc++/qplatformdefs.h

qtbase-5.13.2p0:x11/qt5/qtbase,-main:/usr/local/lib/qt5/mkspecs/linux-clang-libc++-32/

qtbase-5.13.2p0:x11/qt5/qtbase,-main:/usr/local/lib/qt5/mkspecs/linux-clang-libc++-32/qmake.conf

qtbase-5.13.2p0:x11/qt5/qtbase,-main:/usr/local/lib/qt5/mkspecs/linux-clang-libc++-32/qplatformdefs.h

qtbase-5.13.2p0:x11/qt5/qtbase,-main:/usr/local/lib/qt5/mkspecs/linux-clang-libc++/

qtbase-5.13.2p0:x11/qt5/qtbase,-main:/usr/local/lib/qt5/mkspecs/linux-clang-libc++/qmake.conf

qtbase-5.13.2p0:x11/qt5/qtbase,-main:/usr/local/lib/qt5/mkspecs/linux-clang-libc++/qplatformdefs.h

As you can see, base sets are also in the database used by pkglocate,

so you can easily find if a file is from a set (that you should

have) or if the file comes from a package.

Find which package installed a file

Klemmens Nanni (kn@) told me it's possible to find which package

installed a file present in the filesystem using `pkg_info` command

which comes from the base system. This can be handy to know from

which package an installed file comes from, without requiring

pkglocatedb.

$ pkg_info -E /usr/local/bin/convert

/usr/local/bin/convert: ImageMagick-6.9.10.86p0

ImageMagick-6.9.10.86p0 image processing tools

This tells me `convert` binary was installed by ImageMagick package.