sudo raspi-config
root設置
sudo passwd root
su root
sudo -s
echo -e "deb http://mirrors.ustc.edu.cn/raspbian/raspbian/ stretch main contrib non-free rpi \n deb-src http://mirrors.ustc.edu.cn/raspbian/raspbian/ stretch main contrib non-free rpi" > /etc/apt/sources.list
echo -e "deb http://mirrors.ustc.edu.cn/archive.raspberrypi.org/ stretch main ui" > /etc/apt/sources.list.d/raspi.list
exit
sudo apt update && sudo apt -y upgrade
安裝VNC
sudo apt-get install tightvncserver
vncpasswd
sudo nano /etc/init.d/tightvncserver
在文件中粘貼如下內容:
#!/bin/sh
### BEGIN INIT INFO
# Provides: tightvncserver
# Required-Start: $local_fs
# Required-Stop: $local_fs
# Default-Start: 2 3 4 5
# Default-Stop: 0 1 6
# Short-Description: Start/stop tightvncserver
### END INIT INFO
# More details see:
# http://www.penguintutor.com/linux/tightvnc
### Customize this entry
# Set the USER variable to the name of the user to start tightvncserver under
export USER='pi'
### End customization required
eval cd ~$USER
case "$1" in
start)
# 啓動命令行。此處自定義分辨率、控制檯號碼或其它參數。
su $USER -c '/usr/bin/tightvncserver -depth 16 -geometry 1280x700 :1'
echo "Starting TightVNC server for $USER "
;;
stop)
# 終止命令行。此處控制檯號碼與啓動一致。
su $USER -c '/usr/bin/tightvncserver -kill :1'
echo "Tightvncserver stopped"
;;
*)
echo "Usage: /etc/init.d/tightvncserver {start|stop}"
exit 1
;;
esac
exit 0
sudo chmod 755 /etc/init.d/tightvncserver
sudo update-rc.d tightvncserver defaults
用putty連接樹莓派,輸入命令:
vncserver -geometry 1422x800
設置靜態ip
sudo nano /etc/dhcpcd.conf
interface eth0
static ip_address=192.168.137.66/24
static routers=192.168.137.1
static domain_name_servers=8.8.8.8 114.114.114.114
安裝php7.0
sudo apt-get install php7.0 php7.0-fpm
設置中文
sudo raspi-config→Internationalisation Options →Change Locale
en_GB.UTF-8 UTF-8星號去掉
”en_US.UTF-8 UTF-8“,”zh_CN.UTF-8 UTF-8“,”zh_CN.GBK GBK”加星號
tab→ok
選擇zh_CN UTF-8 回車 重啓
sudo apt-get install ttf-wqy-zenhei
sudo apt-get install scim-pinyin
sudo raspi-config
重啓