The presence or absence of the which program in the main LFS book is probably one of the most contentious issues on the mailing lists. It has resulted in at least one flame war in the past. To hopefully put an end to this once and for all, presented here are two options for equipping your system with which. The question of which “which” is for you to decide.
The first option is to install the actual GNU which package.
Download (HTTP): https://mirror.csclub.uwaterloo.ca/gnu//which/which-2.23.tar.gz
Download SHA256 Sum: a2c558226fc4d9e4ce331bd2fd3c3f17f955115d2c00e447618a4ef9978a2a73
Download MD5 sum: 1963b85914132d78373f02a84cdb3c86
Download size: 197 KB
Estimated disk space required: 1.2 MB
Estimated build time: less than 0.1 SBU
Install which by running the following commands:
./configure --prefix=/usr && make
This package does not come with a test suite.
Now, as the root user:
make install