1、系统安装
1.1、下载镜像:详见官网
下载SDFormatterv4:https://www.sdcard.org/downloads/formatter_4/
下载Win32DiskImager:https://sourceforge.net/projects/win32diskimager/
1.2、准备一张大于8GB的TF卡,使用SDFormatterv4格式化TF
1.3、用Win32DiskImager将镜像写入TF中
2、系统配置
2.1、修改文件系统大小
输入sudo fdisk /dev/mmcblk0
输入d 回车
输入2 回车
输入n 回车
输入p 回车
输入2 回车
输入 回车 回车 w 回车
然后重启系统后输入sudo resize2fs /dev/mmcblk0p2
再重启系统
2.2、设置网络文件共享
2.2.1、安装Samba
1 2 |
sudo apt-get <span class="hljs-keyword">install</span> samba sudo apt-<span class="hljs-keyword">get</span> <span class="hljs-keyword">install</span> smbclient |
2.2.2、配置Samba
1 |
<span class="hljs-attribute">sudo</span> nano /etc/samba/smb.conf |
在文件尾添加:
1 2 3 4 5 6 7 8 9 10 |
[share] comment=this is Linux share directory path=/home read only = <span class="hljs-literal">no</span> create mask = <span class="hljs-number">0777</span> directory mask = <span class="hljs-number">0777</span> guest ok = <span class="hljs-literal">yes</span> browseable = <span class="hljs-literal">yes</span> public=<span class="hljs-literal">yes</span> writable=<span class="hljs-literal">yes</span> |
保存Ctrl+o退出Ctrl+x
2.2.3、启动Samba服务:
1 |
<span class="hljs-attribute">sudo</span> /etc/init.d/samba restart |
在Windows下访问共享目录:
\\192.168.1.102\share
2.3、设置VNC远程控制
2.3.1、安装tightvncserver
1 |
sudo apt-<span class="hljs-keyword">get</span> install tightvncserver |
2.3.2、设置密码
1 |
vncpasswd |
2.3.3、设置开机自启动
1 |
<span class="hljs-attribute">sudo</span> nano /etc/init.d/tightvncserver |
输入:
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 |
<span class="hljs-meta">#!/bin/sh</span> <span class="hljs-comment">### BEGIN INIT INFO</span> <span class="hljs-comment"># Provides: tightvncserver</span> <span class="hljs-comment"># Required-Start: $local_fs</span> <span class="hljs-comment"># Required-Stop: $local_fs</span> <span class="hljs-comment"># Default-Start: 2 3 4 5</span> <span class="hljs-comment"># Default-Stop: 0 1 6</span> <span class="hljs-comment"># Short-Description: Start/stop tightvncserver</span> <span class="hljs-comment">### END INIT INFO</span> <span class="hljs-comment"># More details see:</span> <span class="hljs-comment"># http://www.penguintutor.com/linux/tightvnc</span> <span class="hljs-comment">### Customize this entry</span> <span class="hljs-comment"># Set the USER variable to the name of the user to start tightvncserver under</span> <span class="hljs-built_in">export</span> USER=<span class="hljs-string">'pi'</span> <span class="hljs-comment">### End customization required</span> <span class="hljs-built_in">eval</span> <span class="hljs-built_in">cd</span> ~<span class="hljs-variable">$USER</span> <span class="hljs-keyword">case</span> <span class="hljs-string">"<span class="hljs-variable">$1</span>"</span> <span class="hljs-keyword">in</span> start) <span class="hljs-comment"># 启动命令行。此处自定义分辨率、控制台号码或其它参数。</span> su <span class="hljs-variable">$USER</span> -c <span class="hljs-string">'/usr/bin/tightvncserver -depth 16 -geometry 960x600 :1'</span> <span class="hljs-built_in">echo</span> <span class="hljs-string">"Starting TightVNC server for <span class="hljs-variable">$USER</span> "</span> ;; stop) <span class="hljs-comment"># 终止命令行。此处控制台号码与启动一致。</span> su <span class="hljs-variable">$USER</span> -c <span class="hljs-string">'/usr/bin/tightvncserver -kill :1'</span> <span class="hljs-built_in">echo</span> <span class="hljs-string">"Tightvncserver stopped"</span> ;; *) <span class="hljs-built_in">echo</span> <span class="hljs-string">"Usage: /etc/init.d/tightvncserver {start|stop}"</span> <span class="hljs-built_in">exit</span> 1 ;; <span class="hljs-keyword">esac</span> <span class="hljs-built_in">exit</span> 0 |
保存Ctrl+o退出Ctrl+x
2.3.4、设置文件权限,更新开机自启动列表
1 2 |
sudo chmod 777 /etc/init.d/tightvncserver sudo <span class="hljs-keyword">update</span>-rc.d tightvncserver <span class="hljs-keyword">defaults</span> |
2.3.5、在Windows或Android VNC客户端连接:192.168.1.102:5901即可
2.4、设置Windows远程桌面
2.4.1、安装xrdp
1 |
sudo apt-<span class="hljs-keyword">get</span> install xrdp |
2.4.2、Windows端使用mstsc.exe连接即可
2.5、安装输入法
2.5.1、安装ibus
1 2 |
sudo apt-get <span class="hljs-keyword">install</span> ibus sudo apt-<span class="hljs-keyword">get</span> <span class="hljs-keyword">install</span> ibus-pinyin |
2.5.2、设置ibus输入法:系统设置->语言支持->键盘输入方式系统 改为 IBus
2.6、更新
首先替换软件源,原始的源速度很慢,
cp /etc/apt/sources.list /etc/apt/sources.list.bak
vi /sources.list,并将原来的文件删除,替换为如下内容:
deb http://mirrors.ustc.edu.cn/ubuntu-ports/ xenial main restricted universe multiverse
deb-src http://mirrors.ustc.edu.cn/ubuntu-ports/ xenial main restricted universe multiverse
deb http://mirrors.ustc.edu.cn/ubuntu-ports/ xenial-updates main restricted universe multiverse
deb-src http://mirrors.ustc.edu.cn/ubuntu-ports/ xenial-updates main restricted universe multiverse
deb http://mirrors.ustc.edu.cn/ubuntu-ports/ xenial-security main restricted universe multiverse
deb-src http://mirrors.ustc.edu.cn/ubuntu-ports/ xenial-security main restricted universe multiverse
deb http://mirrors.ustc.edu.cn/ubuntu-ports/ xenial-backports main restricted universe multiverse
deb-src http://mirrors.ustc.edu.cn/ubuntu-ports/ xenial-backports main restricted universe multiverse
之后,再运行:
1 2 |
sudo apt-get <span class="hljs-keyword">update</span> sudo apt-<span class="hljs-keyword">get</span> <span class="hljs-keyword">upgrade</span> |
1 2 3 |
sudo rpi-<span class="hljs-keyword">update <img class="alignnone size-full wp-image-293" src="http://7ke.top/wordpress/wp-content/uploads/2017/02/f74a1900c0f409763acc86cbbcdea07a.jpeg" alt="" width="500" height="334" /> </span> |