Nothing would be more frustrating than to install apt packages from sources outside of China, especially from PPA.
If you try to update the c++ compiler to
sudo add-apt-repository ppa:ubuntu-toolchain-r/test -y sudo apt-get update sudo apt-get install g++-7 -y
it may takes your hours to get it done.
But if you have a socks5 proxy out there, things will become better. The idea is to use
apt-get behind a socks5 proxy.
proxychains are common-used tools for this purpose. Here I choose
tsocks due to the DNS issue of
tsocks mentioned by this.
sudo apt-get install proxychains
- setup for
Since my socks5 proxy server is running at
1080, my setting is
socks5 127.0.0.1 1080
at the last line of
sudo proxychains apt-get update sudo proxychains apt-get install g++-7 -y
Done in minutes!
You can also use the proxychains for other software as below:
sudo proxychains synaptic proxychains julia