Some existing answers are wrong as they are not searching reverse dependency, some others are missing some details that may cause confusion, and some are not using pacman which is what the OP asked for, although I personally like the answer as it gives the right answer. After some minutes of reading and searching, this is what I could gather:
Assume we have a package named "X" and we want to see which packages depend on X. Now we have two conditions:
- If you do not have the package X installed and just want to get the info from the repos, you can use
pacman -Sii X
- If you have it installed (which this is what answers the OP's question), you should use
pacman -Qii X
In both of the commands above, you should look the Required By: and Optional For: fields. The following is example of highway-git which is required by libjxl:
❯ pacman -Qii highway-git
Name : highway-git
Version : 1.0.4.r256.g89c0310-1
Description : A C++ library for SIMD (Single Instruction, Multiple Data) (git version)
Architecture : x86_64
URL : https://github.com/google/highway/
Licenses : Apache
Groups : None
Provides : highway
Depends On : gcc-libs
Optional Deps : None
Required By : libjxl
Optional For : None
Conflicts With : highway
Replaces : None
Installed Size : 5.45 MiB
Packager : Unknown Packager
Build Date : Wed 31 May 2023 11:33:59 AM EEST
Install Date : Wed 31 May 2023 11:36:16 AM EEST
Install Reason : Installed as a dependency for another package
Install Script : No
Validated By : None
Backup Files :
(none)
It worth mentioning that the pacman -Sii X does not work if the X is an AUR package, but pacman -Qii X does work on AUR because it is already installed and the info exists on your computer.
For further reading you can go to Arch wiki for Pacman. The info above is very briefly mentioned in the first row of the table (at least at the time of writing this answer).