12

I'm using a installation scripts that needs setcap and it's not found. What package contains it? libcap2 is already installed.

14

Searching for setcap

I believe setcap is contained in this package libcap2-bin. I found this by googling for "debian setcap" which led me to this man page:

The title of the man page tells you which package it resides in:

/ jessie / libcap2-bin / setcap(8)

Now that we "think" we know the package's name we can search for it:

If you scroll down to the bottom of that page you'll see all the various architectures. Click the link for amd64:

Found it

And there's setcap:

File list of package libcap2-bin in jessie of architecture amd64
/sbin/capsh
/sbin/getcap
/sbin/getpcaps
/sbin/setcap
/usr/share/doc/libcap2-bin/README.Debian
/usr/share/doc/libcap2-bin/changelog.Debian.gz
/usr/share/doc/libcap2-bin/changelog.gz
/usr/share/doc/libcap2-bin/copyright
/usr/share/man/man1/capsh.1.gz
/usr/share/man/man1/getpcaps.1.gz
/usr/share/man/man5/capability.conf.5.gz
/usr/share/man/man8/getcap.8.gz
/usr/share/man/man8/pam_cap.8.gz
/usr/share/man/man8/setcap.8.gz
  • @gabriel-a-zorrilla - if this resolves your issue please mark it as accepted so other's know your issue's been resolved. – slm Jul 16 '18 at 11:06
6

Just do a search to see if a package has that command using

apt-file search setcap

if apt-file is not install first get it installed then re-issue above :

sudo apt install apt-file -y  && sudo apt-file update
apt-file search setcap

the entry you want appears as

libcap2-bin: /sbin/setcap

now you know which package has it so install using

sudo apt-get install libcap2-bin

to see contents of a package issue

dpkg -L some-package
dpkg -L libcap2-bin

where you will see setcap and its get counterpart getcap

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.