Running UbuntuMate on Raspberrypi3 with a USB disk
1. Why UbuntuMate?
Raspberrypi’s officail support OS is Raspbian, but I find that it is not very well in supporting Chinese charset.
So I use UbuntuMate 16.04 LTS instead, it seems did more works in international.
2. Prepare
First, Download Win32DiskImager, and the UbuntuMate 16.04 image. It only works under Windows10, I tried it on Mac OSX but failed.
Prepare one USB HDD and one SD card. The SD card needs, not very large, 64M space and above, and mine is 2G.
When the Raspberrypi is booting, you need to connect the USB HDD and put the SD card in too. It seems a waste but this is the only way I found to run a raspberrypi on UbuntuMate.
Connect the USB HDD, use Win32DiskImager to copy the UbuntuMate image on the USB HDD. It will makes the disk divide into 3 partitions. And only the first partition is availible on Win10, you can’t see the others two.
Insert the SD card, copy every file from the HDD to SD card.
Edit the file “cmdline.txt” on SD card:
dwc_otg.lpm_enable=0 console=tty1 root=/dev/mmcblk0p2 rootfstype=ext4 elevator=deadline rootwait
Change to:
dwc_otg.lpm_enable=0 console=tty1 root=/dev/sda2 rootfstype=ext4 elevator=deadline rootwait
Change the “mmcblk0p2“ to “sda2“, and save.
3. Install
Insert the SD card in and connect the USB HDD on the raspi, and power on. It will starts the UbuntuMate install program if everything goes fine.
After the UbuntuMate installed, you will find the second partition, we mentioned above, only has 8G space and the rest has gone.
We need expand the USB HDD’s file system.
sudo fdisk /dev/sda
d,2
n,2,[Enter],[Enter]
w
sudo reboot
sudo resize2fs /dev/sda1
This will makes your HDD have the full space in the second partition.
4. Shadowsocks
Install Shadowsocks-Qt5
sudo add-apt-repository ppa:hzwhuang/ss-qt5
sudo apt-get update
sudo apt-get install shadowsocks-qt5
Start Shadowsocks-Qt5
Install GenPAC and gfwlist.txt
sudo apt-get install python-pip python-dev build-essential
sudo pip install --upgrade pip
sudo pip install --upgrade virtualenv
sudo pip install genpac
cd ~; mkdir shadowsocks; cd shadowsocks
wget http://raw.githubusercontent.com/gfwlist/gfwlist/master/gfwlist.txt
genpac -p "SOCKS5 127.0.0.1:1080" --gfwlist-proxy="SOCKS5 127.0.0.1:1080" --output="autoproxy.pac" --gfwlist-local=gfwlist.txt
Add a proxy
System -> Preference -> Internet and Network -> Network Proxy
Select Automatic Proxy
Set Automatic configure URL as:
file:///home/{USERNAME}/shadowsocks/autoproxy.pac
5. Ohters
Googlepinyin
sudo apt-get install fcitx fcitx-googlepinyin
Mysql
sudo apt-get install mysql-server
sudo vi /etc/mysql/mysql.conf.d/mysqld.cnf
Remember, comment bind-address = 127.0.0.1 using the # symbol