sudo pip3 install -U git+https://github.com/ss/ss.git@master # ss指代的dddd,请自行替换成对应单词
vim /etc/ss.json
{
"server":"server_ip",
"server_port":port,
"local_address":"127.0.0.1",
"local_port":1080,
"password":"mypassword",
"timeout":300,
"method":"aes-256-cfb"
# 根据实际情况自行修改
}
sudo sslocal -c /etc/ss.json # 保持该终端开启
sudo apt-get install privoxy
sudo vim /etc/privoxy/config
sudo privoxy --user privoxy /etc/privoxy/config
sudo systemctl restart privoxy # 可能需要重启privoxy
sudo vim /etc/profile
# 添加下面3行
export http_proxy=http://127.0.0.1:8118
export https_proxy=http://127.0.0.1:8118
export ftp_proxy=http://127.0.0.1:8118
source /etc/profile
系统Network proxy可保持关闭(None)(此时只有终端能走代理),然后就可以rosdep update了
# 如果要实现浏览器代理上网要对系统proxy进行设置
http 127.0.0.1 8118
https 127.0.0.1 8118
socks 127.0.0.1 1080
localhost,127.0.0.0/8,::1
参考
https://blog.csdn.net/beckhans/article/details/89243897
|