Configure Tor with Bridge in Ubuntu

sudo apt-get install tor

After runing tor you can see the log of the tor by

journalctl -exft Tor

If the service started without errors, look at the Tor log

sudo journalctl -b --no-pager /usr/bin/tor
sudo apt install obfs4proxy

then you should get the bridge line. for get the bridge line go to https://bridges.torproject.org/ and get your bridge line.

nano /etc/tor/torrc
UseBridges 1 
ClientTransportPlugin obfs4 exec /usr/bin/obfs4proxy 
Bridge obfs4 132.145.63.40:47347 5C72EEEE587AB1C7021A78707DAB80427F7A9B43 cert=HAZq1DmA4kR1/IFy1TBeSd67BNQI4SDur+U3zxun+G7HCWJ+x66eUyM6/sariPQYDJ9aIw iat-mode=0
Bridge obfs4 132.226.205.56:1991 6CA77FBE6752502259A3D0079F1C510663166404 cert=yrWZOUqsfQ9IyCj3LFwXSqFqbh+59S+1P9yPh/obHt4fbVYrE3ypGthX/+ZvM207I3xIBQ iat-mode=0
Bridge obfs4 45.33.1.189:9123 F9DFF618E7BA6C018245D417F39E970C2F019BAA cert=mDZuXuqSTjX1OjN7zLybTYzNi0A21A7G0DRNmW79029cSvLYSOk/KhGftcnmxruTmhRfZQ iat-mode=0
systemctl restart tor.service

References
https://askubuntu.com/questions/1183145/how-can-i-configure-tor-with-bridge-and-privoxy-to-proxy-entire-system
https://askubuntu.com/questions/607961/error-with-tor-in-ubuntu14-04

Install Tor with torsocks and proxychains on Ubuntu 18.04

sudo apt install tor torsocks proxychains
tor --hash-password "passwordhere"

CookieAuthentication OR HashedControlPassword (if you choose to uncomment HashedControlPassword, copy the hashed password you got in the previous step and paste it next to HashedControlPassword in the torrc file)

nano /etc/tor/torrc
# This provides a port for our script to talk with. If you set this then be
# sure to also set either CookieAuthentication *or* HashedControlPassword!
#
# You could also use ControlSocket instead of ControlPort, which provides a
# file based socket. You don't need to have authentication if you use
# ControlSocket. For this example however we'll use a port.

ControlPort 9051 # <--- uncomment this ControlPort line

# Setting this will make Tor write an authentication cookie. Anything with
# permission to read this file can connect to Tor. If you're going to run
# your script with the same user or permission group as Tor then this is the
# easiest method of authentication to use.

CookieAuthentication 1 #either uncomment this or below HashedControlPassword line

# Alternatively we can authenticate with a password. To set a password first
# get its hash...
#
# % tor --hash-password "my_password"
# 16:E600ADC1B52C80BB6022A0E999A7734571A451EB6AE50FED489B72E3DF
#
# ... and use that for the HashedControlPassword in your torrc.

HashedControlPassword 16:E600ADC1B52C80BB6022A0E999A7734571A451EB6AE50FED489B72E3DF #if you choose to uncomment this line, paste your hashed password here
sudo /etc/init.d/tor restart

Test

curl 'https://api.ipify.org'
torsocks curl 'https://api.ipify.org'
proxychains curl 'https://api.ipify.org'

References
https://www.linux.com/blog/beginners-guide-tor-ubuntu%20

Run a Tor Bridge on Ubuntu

RunAsDaemon 1
BridgeRelay 1
ORPort 16001
ServerTransportPlugin obfs4 exec /usr/bin/obfs4proxy
ServerTransportListenAddr obfs4 0.0.0.0:16002
ExtORPort auto
ContactInfo [email protected]
Nickname yourNickname
PublishServerDescriptor 0

References
https://community.torproject.org/relay/setup/bridge/debian-ubuntu/
https://scottlinux.com/2016/01/16/how-to-run-a-tor-bridge-on-linux/
https://tails.boum.org/doc/first_steps/startup_options/bridge_mode/index.en.html