# Install Shadowsocks Qt5 on Debian8.7.1

Yesterday my dear friend xuansu recommended me to give Debian a TRY. He told me: “It’s quite stable and has been running without even a mistake for months. It’s based on GNOME and it’s quite awesome and cool! It’s my primary system now!” And he used to told me that Debian possesses the best package management tool. That’s why I switch my development environment to Debian 8.7.1.

I get the latest installation CD file from here[1] due to the best way to download a Linux Distribution is from a Open Mirror, as you know China’s network is quite poor, especially for the exportation. The alike well-known mirrors are TUNA (From Tsinghua University), We(From Neusoft) etc.

### Installation

My Production Environment is OS X El Capitan(10.11). I can tell you that under this OS no other softwares could be called the most powerful Virtual Machine except Parallels Desktop(As Vmware Workstation is too complex and Virtual Box is too unstable). Just Load the ISO file and choose Graphical Install and follow the prompts(Quite easy to guess what to choose, if there are more than two choices, just choose the first one. If you are not convinced if do so is right, just Google it) to install the Debian 8.7.1.

### Install Parallels Desktop Tools

As my software is not up-to-date(PD v.11 not v.12 or maybe v.12 cannot), the system is not completely installed(Can handle graphical processing well, e.g. auto scale the window’s resolution, animation effects, file sharing and etc.). The reason is the newly installed system has not been installed Parallels Tools(As most OS installed, they will not install this tool automatically, except Ubuntu 14.04 LTS and the problem can be solved by installing this tool).

When the system is running, find and click Actions->Install Parallels Tools on the menubar and then enter the system, ignore all the prompts(e.g. open the archive location, playing or so on). Fire terminal, then we need enter some commands.

These commands are for updating the dependencies, to ensure the PT works properly. If you just finish installing the system, when you enter apt-get <command> you will get an error about can not get the lock. It means the system is updating your system in the background, you just have to sit back and wait for no more than 30 minutes and reboot.

Then we need some other commands to tell the system where to find the tool and whether to install.

(Assuming you will not exit the super user)

After that, there will be a prompt interface asking for your confirmation if you truly want to install this software. Choose next and enter. Then you just need to wait and enter reboot. After rebooting, voila, you can find the differences between now and before. The details can be found here[2].

### Common Settings

To get a good network environment , we need to change the sources list to the servers which is nearest to our location, in this case we choose Tsinghua University’s TUNA Mirror. Use sudo vi /etc/apt/sources.list and add such contents:

### Add User Into Sudo Group

Fire terminal and then use su to switch to super user, then enter usermod -aG sudo <username> and vi /etc/sudoers and find

After <root…> this line, just insert a line <username> ALL=(ALL:ALL) ALL. Then, you can switch to normal user to check: sudo ls, enter your normal user’s password, if there’s no error, that means you have grant the user the privilege of sudo. However, remember:

From here[3] you can download the latest version(Also, you can easily use the following commands as the project is hosted on Github, the url is almost impossible to go wrong)[4].

And if you are tired of compiling or building up the package, or you don’t want to “waste” your time, well, you can go to this post[5]. It provides the al-compiled package, you just need to download and sudo dpkg -i *.deb! Thanks again for my old friend’s contribution! Also, if you prefer, you can use my compiled debs. Use sudo dpkg -i *.deb to install these three files: libqtshadowsocks-dev libqtshadowsocks shadowsocks-libqtshadowsocks and finally install shadowsocks-qt5.

So, you can press Home/Windows and type shadowsocks-qt5 to open this software and add your own config(Do not forget to connect manually), also, you still have one more step to do:
Install FoxyProxy. There’s nothing different as make configurations on Windows/OS X(host->127.0.0.1, port->1080, etc.). But recently I have mistakenly deleted my repo and that means even for me, I CANNOT use PAC mode, unless I build the PAC file again, or choose to use others. Never mind, that’s not the point. At least we can pass through GFW, although a little troublesome.

### Other Configurations

Since I newly installed an OS, that means I have to make a lot of changes on it(Language, Softwares, Themes and etc.) So, here are some extra(Post-Title-Free, namely, nonsense, just to avoid creating another post) steps I take.

#### Proxychains

We can bypass the firewall only if the software supports Proxy(Socks 5), and how about terminal(Command Line)? That’s why I have to installed this software(Under linux, nothing is more important than terminal).

If you want to set more detailed configurations, refer to this sample[6].

And add the following lines and save[7]:

Now, you can enter proxychains bash and use curl https://www.google.com to test if your terminal can get access to Google.

#### Change Source(Deprecated)

As the network environment on mainland China is really poor, there’s a great need for us to change our source to a mainland mirror server. Here, I still choose the USTC Mirror.

Use cp /etc/apt/source.list /etc/apt/source.list.bak to back up your original source file in case you break your file by accident so that you can recover it. The content looks like:

As you select the mirror when installing this system, the http://ftp.cn.debian.org may displays different(e.g. http://ftp.cn.debian.org/debian/). Considering that my ISP provides a poor IPv6 service and to avoid the domain name resolution going through IPv6 to USTC Mirror, we are going to use http://mirrors4.ustc.edu.cn to force the route to go through IPv4. We can easily use vi to open source.list and use :%s/ftp.us.debian.org/mirrors4.ustc.edu.cn/g [8]to replace the domain globally. Then save it and use sudo apt-get update to update the cache.

#### Install Codeblocks

As usual, I choose to install codeblocks(The best C/CPP dev tool for my daily use) from downloading the official installation file and install it. For example, from here[9] we can get the latest released binary file. And after that, you can extra the files by default GUI tool Archive Manager to the same directory and enter the directory jessie/amd64 in command line . Next thing you should do is use sudo dpkg -i *.deb to install the deb files. Unluckily, there are still some dependencies needed for this software to run normally, so you will see a lot of errors, e.g.

Thanks to Debian’s elegant design of package management, we can easily use sudo apt-get install -f to fix the dependencies automatically. At last, we just need to use sudo dpkg -i *.deb to install codeblocks again.

External Guides

Don’t know why, maybe it is because the new version of codeblocks adopted the new GTK(2.8->3.0), there are still a lot of bugs, for example, the most annoying one: Every time you create a new file and when saving it, the ERROR occurs. Just like following:

The cause of this error is Symbol Browser. I’ve tried to solve this problem but I failed. So, the only choice left for me is to disable symbol browser even if I have no idea of what it truly is. Go to Seetings->Editor->Code completion->Symbols browser and check Disable symbols browser and confirm and next time you create a new file and save, no more annoying alerts will jump off[10].