Step 1:download APK from https://f-droid.org/zh_Hans/packages/com.termux/
Step 2:
follow:
Recent versions of Ruby have serious problem related to how Android's linker works with shared libraries. We had to package Metasploit with all necessary fixes and now it is available in Unstable Termux repository. All other ways of Metasploit installation are no longer viable.
Use the following commands to install the package:pkg install unstable-repo
pkg install metasploit
Installation may take long time since additional Ruby gems will be installed. Do not close Termux sessions until installation finishes to avoid introducing of potential inconsistencies that may be introduced in $PREFIX.
Warning: do not manually upgrade metasploit installed through package with editing contents of $PREFIX/opt/metasploit. This will likely break installation and result in dependency problems. Do not report issues if you did this.
Step 3:
Done
or you can follow under to install.