5

I have recently installed the cryptsetup. I've double checked with sudo apt-get install cryptsetup.

Reading package lists... Done
Building dependency tree... Done
Reading state information... Done
cryptsetup is already the newest version (2:2.3.7-1+deb11u1).
0 upgraded, 0 newly installed, 0 to remove and 0 not upgraded.

However when I try to use the command it does not recognize it.

bash: cryptsetup: command not found

Then I tried to find the location of the command using which. which cryptsetup

However the command does not return anything. man cryptsetup says that cryptsetup indeed is the right command name. What is wrong here?

1 Answers1

15

cryptsetup is installed in /sbin, which isn’t on users’ PATH by default; as a result, which can’t find it.

If you run which as root, it should find cryptsetup:

$ which cryptsetup
cryptsetup not found
$ sudo which cryptsetup
/sbin/cryptsetup

(Regarding which, see Why not use "which"? What to use then?)

Stephen Kitt
  • 434,908
  • Instead of generically not using which, for the particular case where you've installed a package on a Debian system, run dpkg-query -L cryptsetup (or whatever). It'll list the files installed by the package. There are of course equivalents for other package managers. – Useless Dec 18 '22 at 02:32