树莓派配置指南

下载烧录镜像

镜像下载地址

http://downloads.raspberrypi.org/raspbian/images/raspbian-2017-04-10/

写入sd卡(需要一个读卡器

下载etcher

mark

镜像烧好后

在boot路径下新建一个命名为ssh(无后缀)的空白文件,使得ssh默认开启。

参考这个用一根网线连接电脑去操作(windows)
http://shumeipai.nxez.com/2013/10/15/raspberry-pi-and-a-network-cable-directly-connected-laptop.html

或者和我一样用一根网线直接插在路由器后面

mark

也可以不用网线,直接配置无线上网,不赘述。http://shumeipai.nxez.com/2017/09/13/raspberry-pi-network-configuration-before-boot.html

远程连接

找到ip后用ssh远程连接,默认账号密码为

user:pi

password:raspberry

换源

修改/etc/apt/sources.list为

1
2
3
4
# deb http://mirrordirector.raspbian.org/raspbian/ jessie main contrib non-free rpi
# Uncomment line below then 'apt-get update' to enable 'apt-get source'
# deb-src http://archive.raspbian.org/raspbian/ jessie main contrib non-free rpi
deb https://mirrors.tuna.tsinghua.edu.cn/raspberrypi/ jessie main ui

sudo apt-get update

安装vim

sudo apt-get install vim

释放限制空间(封印解除

sudo raspi-config

mark

mark

打开vnc

mark

mark

vnc开机自启动设置

vim /etc/init.d/vncserver

然后 复制下面的内容 右键粘贴进去

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
#!/bin/sh
### BEGIN INIT INFO
# Provides: vncserver
# Required-Start: $local_fs
# Required-Stop: $local_fs
# Default-Start: 2 3 4 5
# Default-Stop: 0 1 6
# Short-Description: Start/stop vncserver
### END INIT INFO

# More details see:
# http://www.penguintutor.com/linux/vnc

### Customize this entry
# Set the USER variable to the name of the user to start vncserver under
export USER='pi'
### End customization required

eval cd ~$USER

case "$1" in
start)
# 启动命令行。此处自定义分辨率、控制台号码或其它参数。
su $USER -c '/usr/bin/vncserver -depth 16 -geometry 1024x768 :1'
echo "Starting VNC server for $USER "
;;
stop)
# 终止命令行。此处控制台号码与启动一致。
su $USER -c '/usr/bin/vncserver -kill :1'
echo "vncserver stopped"
;;
*)
echo "Usage: /etc/init.d/vncserver {start|stop}"
exit 1
;;
esac
exit 0

修改权限

sudo chmod 755 /etc/init.d/vncserver

添加开机启动项

sudo update-rc.d vncserver defaults

最后 重启树莓派

sudo reboot

安装VNC Viewer

链接:https://pan.baidu.com/s/1jJAy7bg 密码:gnyy

输入ip:1

mark

mark

mark