Install and Use torsocks on Ubuntu
sudo apt install torsocks
if you need to change configuration :
/etc/tor/torsocks.conf
Proxify applications
curl https://api.ipify.org?format=json
torsocks curl https://api.ipify.org?format=json
Set shell to use Torsocks by default
. torsocks on
. torsocks off
References
https://www.binarytides.com/proxify-applications-with-torsocks/
https://linuxconfig.org/install-tor-proxy-on-ubuntu-20-04-linux