ubuntu 安装编译shodowsocks-qt并配置代理
ubuntu 安装编译shodowsocks-qt并配置代理
因sh_啊dowsocks为敏感词,所以记得讲本文中所有的shodowsocks替换回来!!!
总体依赖要求
Make sure you've installed all dependent development packages (with -dev
or -devel
).
cmake
>= 3.1.0qt5-qtbase-gui
>= 5.2 (qtbase5
in Debian/Ubuntu)qrencode
(libqrencode
in Debian/Ubuntu)libQtShodowsocks
>= 1.10.0 (libqtshodowsocks
in Debian/Ubuntu. DON'T use the trunk code)zbar
(libzbar0
orlibzbar
in Debian/Ubuntu)libappindicator
(libappindicator1
in Debian/Ubuntu)
见:https://github.com/shodowsocks/shodowsocks-qt5/wiki/Compiling
安装相关依赖
sudo apt-get install synaptic # 安装新立德包管理器(包管理工具apt的图形化前端,可不装)
sudo apt-get install cmake qtbase5-dev libqrencode-dev libzbar0 libappindicator1 libzbar-dev # 安装相关依赖
安装Botan
wget https://botan.randombit.net/releases/Botan-2.9.0.tgz 下载Botan
tar xvf Botan-2.9.0.tgz
cd Botan-2.9.0
python ./configure.py # 需要提前安装python,python3.8可用
make -j4
sudo make install
sudo ldconfig
Botan也可以在 https://botan.randombit.net/releases/ 里直接下载,要求:
- Botan-2 >= 2.3.0
- Or Botan-1.10 (Not recommended)
安装libQtShodowsocks :
相关前置依赖(已在前面安装好)
- Qt >= 5.5
- Botan-2 >= 2.3.0
- Or Botan-1.10 (Not recommended)
- CMake >= 3.1
- A C++ Compiler that supports C++14 features (i.e. GCC >= 4.9)
git clone https://github.com/shodowsocks/libQtShodowsocks # 下载libQtShodowsocks
cd libQtShodowsocks
mkdir build && cd build
cmake .. -DUSE_BOTAN2=ON -DUSE_BOTAN2=ON
make -j4
sudo make install
https://github.com/shodowsocks/libQtShodowsocks/wiki/Compiling
Botan-1.10 vs Botan-2(为什么要上面要加上-DUSE_BOTAN2=ON指令)
libQtShodowsocks
is compiled against Botan-1.10
by default, to use Botan-2
, you need to pass an additional argument -DUSE_BOTAN2=ON
to cmake
command.
安装shodowsocks-qt5
git clone https://github.com/shodowsocks/shodowsocks-qt5 下载shodowsocks-qt5
cd shodowsocks-qt5
mkdir build && cd build
cmake ..
make -j4
sudo make install
https://github.com/shodowsocks/shodowsocks-qt5/wiki/Compiling
安装完毕后
终端输入:ss-qt5 或者 点击图标来打开shodowsocks-qt5,如果能打开是最好的。
打不开的解决方法:
终端输入:sudo apt install -f
Ubuntu使用Shodowsocks-qt5上网
配置shodowsocks-qt5
填写(也可以先自动化导入后再修改)对应的服务器IP,端口,密码,加密方式。
图中Local Port指代理端口,一般是1080.
红色标注地方请与图片一样。
配置系统代理模式
配置浏览器代理模式(本次为Ubuntu自带FireFox浏览器为例)
连接并开始上网
第二种方法:直接下载
https://pan.baidu.com/link/zhihu/7FhDzRuMhDi3NzVzsGe2p5EHUyMyR1XQUadz==
chmod 777 Shodowsocks-Qt5-3.0.1-x86_64.AppImage
./Shodowsocks-Qt5-3.0.1-x86_64.AppImage
再制作一个桌面启动
编辑ssr.desktop
└─$ cat ssr.desktop
[Desktop Entry]
Name=shodowsocks
Exec=/home/dillan/Tools/Shodowsocks-Qt5-3.0.1-x86_64.AppImage
Icon=/home/dillan/Tools/shodowsocksqt5_94122.png
Type=Application
StartupNotify=true
Name: 启动程序名称
Exec:下载的shodowsocks 文件
Icon:图表,可以随意去网上下载
然后把desktop 移动到 /usr/share/applications
mv ssr.desktop /usr/share/applications
这样可以直接加入到收藏夹直接启动
参考链接
https://zhuanlan.zhihu.com/p/466308447
https://sgi.anycast.gay/user/tutorial
https://github.com/shodowsocks/libQtShodowsocks/wiki/Compiling
https://github.com/shodowsocks/shodowsocks-qt5/wiki/Compiling