【树莓派4B测评】+ 系统安装及环境搭建
<div class='showpostmsg'> 本帖最后由 sylar^z 于 2020-8-17 23:02 编辑<p style="text-indent:21.0000pt; text-align:justify"><span style="font-size:10.5pt"><span style="font-family:Calibri"><span style="font-size:10.5000pt"><span style="font-family:宋体"><font face="宋体">在树莓派的官方资源库下载了</font>32<font face="宋体">位和</font><font face="Calibri">64</font><font face="宋体">位两个版本的系统镜像,链接查看我的开箱贴(</font></span></span></span></span><a href="https://bbs.eeworld.com.cn/thread-1137237-1-1.html">https://bbs.eeworld.com.cn/thread-1137237-1-1.html</a><span style="font-size:10.5pt"><span style="font-family:Calibri"><span style="font-size:10.5000pt"><span style="font-family:宋体"><font face="宋体">)。解压后</font><font face="Calibri">64</font><font face="宋体">位系统的大小为</font><font face="Calibri">3.45G</font><font face="宋体">,</font><font face="Calibri">32</font><font face="宋体">位系统的大小为</font><font face="Calibri">3.56G</font><font face="宋体">,差不多。既然是</font><font face="Calibri">64</font><font face="宋体">位的</font><font face="Calibri">Soc</font><font face="宋体">就先安装</font><font face="Calibri">64</font><font face="宋体">位系统了。</font></span></span></span></span></p>
<p style="text-indent:21.0000pt; text-align:justify"><span style="font-size:10.5pt"><span style="font-family:Calibri"><span style="font-size:10.5000pt"><span style="font-family:宋体"><font face="宋体">网上下载一个</font>win32diskimager<font face="宋体">软件,用来将系统镜像烧入到</font><font face="Calibri">SD</font><font face="宋体">中。</font></span></span></span></span></p>
<p style="text-indent:21.0000pt; text-align:justify"> </p>
<p style="text-indent:21.0000pt; text-align:justify"><span style="font-size:10.5pt"><span style="font-family:Calibri"><span style="font-size:10.5000pt"><span style="font-family:宋体"><font face="宋体">在界面上选择要烧写的镜像和目标存储器盘符。点击写就开始写镜像了。</font></span></span></span></span></p>
<p style="text-indent:21.0000pt; text-align:justify"></p>
<p style="text-indent:21.0000pt; text-align:justify"><span style="font-size:10.5pt"><span style="font-family:Calibri"><span style="font-size:10.5000pt"><span style="font-family:宋体"><font face="宋体">系统写入后,</font>SD<font face="宋体">卡被分为两个分区,一个</font><font face="Calibri">LINUX</font><font face="宋体">格式的盘,在</font><font face="Calibri">windows</font><font face="宋体">下不可见。另一个是</font></span></span><span style="font-size:10.5000pt"><span style="font-family:Calibri">windows</span></span><span style="font-size:10.5000pt"><span style="font-family:宋体"><font face="宋体">格式的</font>boot<font face="宋体">盘,只有</font><font face="Calibri">252M</font><font face="宋体">,可用</font><font face="Calibri">199M</font><font face="宋体">。</font></span></span></span></span></p>
<p style="text-indent:21.0000pt; text-align:justify"><span style="font-size:10.5pt"><span style="font-family:Calibri"><span style="font-size:10.5000pt"><span style="font-family:宋体"><font face="宋体">配置无线网络连接</font></span></span></span></span></p>
<p style="text-indent:21.0000pt; text-align:justify">打开SD卡,在根目录创建一个wpa_supplicant.conf文件。用写字板或则<a h="ID=SERP,5122.2" href="https://notepad-plus-plus.org/">Notepad++</a>打开,添加以下内容:</p>
<div aria-label="代码段 小部件" contenteditable="false" role="region" tabindex="-1">
<pre data-widget="codesnippet">
<code></code></pre>
<img src="data:image/gif;base64,R0lGODlhAQABAPABAP///wAAACH5BAEKAAAALAAAAAABAAEAAAICRAEAOw==" /><span bbs.eeworld.com.cn="" editor="" handle.png="" http:="" images="" plugins="" static="" style="background: url("<imgdata-cke-saved-src=" widget="">") rgba(220, 220, 220, 0.5); top: -15px; left: 0px; display: block;"><img height="15" role="presentation" src="data:image/gif;base64,R0lGODlhAQABAPABAP///wAAACH5BAEKAAAALAAAAAABAAEAAAICRAEAOw==" title="点击并拖拽以移动" width="15" /></span></div>
<p style="text-indent:21.0000pt; text-align:justify">其中注释的scan_ssid = 1是用于连接非广播型AP的账号,树莓派会对该SSID进行扫描,以便链接。</p>
<p style="text-indent:21.0000pt; text-align:justify"> </p>
<p style="text-indent:21.0000pt; text-align:justify"><span style="font-size:10.5pt"><span style="font-family:Calibri"><span style="font-size:10.5000pt"><span style="font-family:宋体"><font face="宋体">开启树莓派</font>SSH<font face="宋体">功能</font></span></span></span></span></p>
<p style="text-indent:21.0000pt; text-align:justify"><span style="font-size:10.5pt"><span style="font-family:Calibri"><span style="font-size:10.5000pt"><span style="font-family:宋体"><font face="宋体">打开</font>SD<font face="宋体">卡,在根目录新建一个文件名为</font><font face="Calibri">SSH</font><font face="宋体">的空文件,这样在树莓派上电后,就会设置开机自动开启</font><font face="Calibri">SSH</font><font face="宋体">功能。</font></span></span></span></span></p>
<p style="text-indent:21.0000pt; text-align:justify"> </p>
<p style="text-indent:21.0000pt; text-align:justify"><span style="font-size:10.5pt"><span style="font-family:Calibri"><span style="font-size:10.5000pt"><span style="font-family:宋体"><font face="宋体">使用</font>PUTTY SSH<font face="宋体">连接树莓派</font></span></span></span></span></p>
<p style="text-align:justify"><span style="font-size:10.5pt"><span style="font-family:Calibri"><span style="font-size:10.5000pt"><span style="font-family:宋体"><font face="宋体"> 首先要通过路由器确定树莓派的</font>IP<font face="宋体">,再在</font><font face="Calibri">PUTTY</font><font face="宋体">上要输入树莓派</font><font face="Calibri">IP</font><font face="宋体">,端口默认为</font><font face="Calibri">22</font><font face="宋体">。</font></span></span></span></span></p>
<p style="text-align:justify"></p>
<p style="text-align:justify"><span style="font-size:10.5pt"><span style="font-family:Calibri"><span style="font-size:10.5000pt"><span style="font-family:宋体"><font face="宋体"> 树莓派的默认账号为</font>pi<font face="宋体">,密码为</font><font face="Calibri">raspberry</font><font face="宋体">。输入密码时,不会显示字符,把密码全部输完后,按回车即可。</font></span></span></span></span></p>
<p style="text-align:justify"></p>
<p style="text-align:justify"><span style="font-size:10.5pt"><span style="font-family:Calibri"><span style="font-size:10.5000pt"><span style="font-family:宋体"><font face="宋体"> 由于我的</font>micro HDMI<font face="宋体">线还在路上,为了在不接显示屏的情况下也能进行显示,也为了后续调试方便。我先给树莓派</font><font face="Calibri">4B</font><font face="宋体">安装了一个远程桌面软件</font></span><span style="font-family:Calibri">xrdp</span><span style="font-family:宋体"><font face="宋体">。</font></span></span></span></span></p>
<p style="text-align:justify"><span style="font-size:10.5pt"><span style="font-family:Calibri"><span style="font-size:10.5000pt"><span style="font-family:宋体"><font face="宋体"> 安装指令</font>:</span></span> <span style="font-size:10.5000pt"><span style="font-family:宋体">sudo apt-get install xrdp. <font face="宋体">中间出现安装选项选</font><font face="Calibri">Y</font><font face="宋体">继续安装。</font></span></span></span></span></p>
<p style="text-align:justify"> </p>
<p style="text-align:justify"><span style="font-size:10.5pt"><span style="font-family:Calibri"><span style="font-size:10.5000pt"><span style="font-family:宋体"><font face="宋体"> 待安装完毕,在</font>windows<font face="宋体">下使用远程桌面直接连接树莓派就</font><font face="Calibri">OK</font><font face="宋体">了。</font></span></span></span></span></p>
<p style="text-align:justify"></p>
<p style="text-align:justify"> <span style="font-size:10.5pt"><span style="font-family:Calibri"><span style="font-size:10.5000pt"><span style="font-family:宋体"><font face="宋体">连上树莓派,打开</font>eeworld</span></span></span></span></p>
<p style="text-align:justify"></p>
<p style="text-align:justify"> </p>
<p style="text-indent:21.0000pt; text-align:justify"><span style="font-size:10.5pt"><span style="font-family:Calibri"><span style="font-size:10.5000pt"><span style="font-family:宋体"><font face="宋体">树莓派软件源更换</font></span></span></span></span></p>
<p style="text-indent:21.0000pt; text-align:justify"><span style="font-size:10.5pt"><span style="font-family:Calibri"><span style="font-size:10.5000pt"><span style="font-family:宋体"><font face="宋体">默认情况下,树莓派软件源地址是</font> </span></span><a href="https://link.zhihu.com/?target=http%3A//archive.raspbian.org/"><span style="font-size:10.5000pt"><span style="font-family:Calibri">http://</span></span><span style="font-size:10.5000pt"><span style="font-family:宋体">archive.raspbian.org/</span></span></a><span style="font-size:10.5000pt"><span style="font-family:宋体"><font face="宋体">,位于欧洲,在国内访问是非常慢的,经常只有几</font>K<font face="宋体">每秒的下载速率。强烈建议替换成国内的软件源。树莓派所有软件源地址:</font></span></span><a href="https://www.raspbian.org/RaspbianMirrors"><span style="font-size:10.5000pt"><span style="font-family:Calibri">https://www.raspbian.org/RaspbianMirrors</span></span></a><span style="font-size:10.5000pt"><span style="font-family:宋体"><font face="宋体">。</font></span></span></span></span></p>
<p style="text-indent:21.0000pt; text-align:justify"><span style="font-size:10.5pt"><span style="font-family:Calibri"><span style="font-size:10.5000pt"><span style="font-family:宋体"><font face="宋体">打开</font>Terminal<font face="宋体">,输入指令</font></span></span><span style="font-size:10.5000pt"><span style="font-family:Calibri">sudo nano /etc/apt/sources.list</span></span><span style="font-size:10.5000pt"><span style="font-family:宋体"><font face="宋体">,回车打开配置文件。使用</font>#<font face="宋体">注释默认源。添加清华大学的软件源:</font></span></span></span></span></p>
<p style="text-indent:21.0000pt; text-align:justify"><span style="font-size:10.5pt"><span style="font-family:Calibri"><span style="font-size:10.5000pt"><span style="font-family:Calibri">deb http://mirrors.tuna.tsinghua.edu.cn/raspbian/raspbian/ buster main non-free contrib</span></span></span></span></p>
<p style="text-indent:21.0000pt; text-align:justify"><span style="font-size:10.5pt"><span style="font-family:Calibri"><span style="font-size:10.5000pt"><span style="font-family:Calibri">deb-src http://mirrors.tuna.tsinghua.edu.cn/raspbian/raspbian/ buster main non-free contrib</span></span></span></span></p>
<p style="text-align:justify"><span style="font-size:10.5pt"><span style="font-family:Calibri"><span style="font-size:10.5000pt"><span style="font-family:宋体"><font face="宋体"> 按</font> ctrl-o <font face="宋体">保存,按 </font><font face="Calibri">ctrl-x </font><font face="宋体">关闭。</font></span></span></span></span></p>
<p style="text-align:justify"></p>
<p style="text-indent:21.0000pt; text-align:justify"><span style="font-size:10.5pt"><span style="font-family:Calibri"><span style="font-size:10.5000pt"><span style="font-family:宋体"><font face="宋体">再输入指令</font> </span></span><span style="font-size:10.5000pt"><span style="font-family:Calibri">sudo nano /etc/apt/sources.list.d/raspi.list</span></span><span style="font-size:10.5000pt"><span style="font-family:宋体"><font face="宋体">。也修改为清华的源:</font></span></span></span></span></p>
<p style="text-indent:21.0000pt; text-align:justify"><span style="font-size:10.5pt"><span style="font-family:Calibri"><span style="font-size:10.5000pt"><span style="font-family:Calibri">deb http://mirrors.tuna.tsinghua.edu.cn/raspberrypi/ buster main ui</span></span></span></span></p>
<p style="text-align:justify"><span style="font-size:10.5pt"><span style="font-family:Calibri"><span style="font-size:10.5000pt"><span style="font-family:宋体"><font face="宋体"> 按</font> ctrl-o <font face="宋体">保存,按 </font><font face="Calibri">ctrl-x </font><font face="宋体">关闭。</font></span></span></span></span></p>
<p style="text-align:justify"></p>
<p style="text-align:justify"><span style="font-size:10.5pt"><span style="font-family:Calibri"><span style="font-size:10.5000pt"><span style="font-family:宋体"><font face="宋体"> 最后,执行</font>sudo apt-get update <font face="宋体">获取软件源的</font></span><span style="font-family:Calibri"><font face="宋体">软件包的列表</font></span></span><span style="font-size:10.5000pt"><span style="font-family:宋体"><font face="宋体">,执行后出现了</font></span></span><span style="font-size:10.5000pt"><span style="font-family:Calibri">The following signatures couldn't be verified because the public key is not available: NO_PUBKEY 9165938D90FDDD2E</span></span><span style="font-size:10.5000pt"><span style="font-family:宋体"><font face="宋体">报错。</font></span></span></span></span></p>
<p style="text-align:justify"></p>
<p style="text-align:justify"><span style="font-size:10.5pt"><span style="font-family:Calibri"><span style="font-size:10.5000pt"><span style="font-family:宋体"><font face="宋体"> 需要把该密匙添加到,使用指令</font></span></span></span></span></p>
<p style="text-align:justify"><span style="font-size:10.5pt"><span style="font-family:Calibri"><span style="font-size:10.5000pt"><span style="font-family:宋体"> gpg --keyserver keyserver.ubuntu.com --recv-keys 9165938D90FDDD2E</span></span></span></span></p>
<p style="text-indent:21.0000pt; text-align:justify"><span style="font-size:10.5pt"><span style="font-family:Calibri"><span style="font-size:10.5000pt"><span style="font-family:宋体">gpg --export --armor 9165938D90FDDD2E | sudo apt-key add -</span></span></span></span></p>
<p style="text-align:justify"></p>
<p style="text-align:justify"><span style="font-size:10.5pt"><span style="font-family:Calibri"><span style="font-size:10.5000pt"><span style="font-family:宋体"><font face="宋体"> 添加完密匙后,再次执行</font>sudo apt-get update,清华的软件源已经连上了,但是好像不支持64位(arm64)系统,等之后安装软件时再研究一下。</span></span></span></span></p>
<p style="text-align:justify"></p>
<p style="text-align:justify"> </p>
<p style="text-align:justify"> </p>
<p style="text-align:justify"> </p>
<p style="text-align:justify"> </p>
<p style="text-align:justify"> </p>
</div><script> var loginstr = '<div class="locked">查看本帖全部内容,请<a href="javascript:;" style="color:#e60000" class="loginf">登录</a>或者<a href="https://bbs.eeworld.com.cn/member.php?mod=register_eeworld.php&action=wechat" style="color:#e60000" target="_blank">注册</a></div>';
if(parseInt(discuz_uid)==0){
(function($){
var postHeight = getTextHeight(400);
$(".showpostmsg").html($(".showpostmsg").html());
$(".showpostmsg").after(loginstr);
$(".showpostmsg").css({height:postHeight,overflow:"hidden"});
})(jQuery);
} </script><script type="text/javascript">(function(d,c){var a=d.createElement("script"),m=d.getElementsByTagName("script"),eewurl="//counter.eeworld.com.cn/pv/count/";a.src=eewurl+c;m.parentNode.insertBefore(a,m)})(document,523)</script> <p>找了几个软件源都无法支持arm64。</p>
<p>从<a href="https://mirror.tuna.tsinghua.edu.cn/">清华大学开源软件镜像站</a>网站上显示是支持arm64的,但实际却无法更新,所以暂时改回默认软件源了。速度奇慢,不到10KB/S。</p>
<p>感谢分享 有个图片没显示出来</p> littleshrimp 发表于 2020-8-21 01:36
感谢分享 有个图片没显示出来
<p>感谢版主提醒,这个代码显示在我修改一次帖子后显示异常了。</p>
<p> </p>
<p>在SD卡根目录新建的wpa_supplicant.conf文件中,写入以下内容:</p>
<p>country=CN<br />
ctrl_interface=DIR=/var/run/wpa_supplicant GROUP=netdev<br />
update_config=1</p>
<p>network={<br />
ssid="你的wifi账号"<br />
psk="你的wifi密码"<br />
# scan_ssid = 1<br />
priority=1<br />
id_str="homeOne"<br />
}</p>
<p><a href="https://bbs.eeworld.com.cn/thread-1137107-1-1.html" target="_blank">树莓派4B测评</a></p>
<p>汇总:<a href="https://bbs.eeworld.com.cn/thread-1137107-1-1.html">https://bbs.eeworld.com.cn/thread-1137107-1-1.html</a></p>
页:
[1]