Can I install packages to external SD card on Termux in Android? I am using Termux in my Android device and it is awesome. I've installed it from Google Play. Now the packages that I install using the command pkg install ..., install those to the internal storage. Since my internal storage space is running low, I am thinking to install these packages to the external SD card. Can I do it? Thank you.
Unfortunately you can't.

The packages you install using pkg install, which is actually a wrapper for the frontend of the famous Debian Package Manager, APT. APT downloads packages provided by Termux and installs them. So the packages are just Debian packages. Witha bit of Googling and/or digging, you'll find that file paths are hardcoded, i.e., they'll always be extracted (installed) into /data/data/com.termux/files/usr.

Possible tricks are, apparently, possible. However it's not recommended to try any as Termux is highly similar to a real Linux environment, which means any bad SELinux context or wrong permission can cause programs to malfunction.

Answer: Try to free up your internal storage if you plan to install more packages in Termux, instead of thinking about installing the packages to elsewhere.