楚堂 發表於 2023-8-16 00:00:00

如何在树莓派 4 上安装 Ubuntu 桌面系统

<p>
        <img style="max-width:100%!important;height:auto!important;"title="如何在树莓派 4 上安装 Ubuntu 桌面系统" alt="如何在树莓派 4 上安装 Ubuntu 桌面系统" border="0" height="auto" src="https://zhuji.jb51.net/uploads/img/202305/41f0165a9b5600fbe5555a5ecc2b0bd1.jpg" width="auto"></p>
<p>
        本教程将详细告诉你在树莓派 4 设备上如何安装 Ubuntu 桌面。</p>
<p>
        革命性的<ruby>树莓派<rt>Raspberry Pi</rt></ruby>是最受欢迎的单板计算机。它拥有基于 Debian 的操作系统,叫做 <ruby>树莓派操作系统<rt>Raspberry Pi OS</rt></ruby>(原名 Raspbian)。</p>
<p>
        还有其他几个 可用于树莓派的操作系统,但几乎所有的都是轻量级的,适合于树莓派设备的小尺寸和低端硬件。</p>
<p>
        随着标榜 8GB 内存和支持 4K 显示的树莓派 4B 的推出,情况发生了变化。其目的是将树莓派作为常规桌面使用,并在更大程度上成功地做到了这一点。</p>
<p>
        在 4B 型号之前,你可以 在树莓派上安装 Ubuntu 服务器,但桌面版本却无法使用。然而,<strong>Ubuntu 现在为树莓派 4 提供了官方的桌面镜像</strong>。</p>
<p>
        在本教程中,我将展示在树莓派 4 上安装 Ubuntu 桌面的步骤。</p>
<p>
        首先,快速了解一下运行要求。</p>
<h3 class="mume-header" id="%E5%9C%A8%E6%A0%91%E8%8E%93%E6%B4%BE-4-%E4%B8%8A%E8%BF%90%E8%A1%8C-ubuntu-%E7%9A%84%E8%A6%81%E6%B1%82">
        在树莓派 4 上运行 Ubuntu 的要求</h3>
<p class="article_img">
         </p>
<p>
        <img style="max-width:100%!important;height:auto!important;"title="如何在树莓派 4 上安装 Ubuntu 桌面系统" alt="如何在树莓派 4 上安装 Ubuntu 桌面系统" border="0" height="auto" src="https://zhuji.jb51.net/uploads/img/202305/29c33902d9d9c0dcf9d046aa70b6c1d6.jpg"></p>
<p>
        以下是你需要的东西:</p>
<ol>
<li>
                一个能够联网的 Linux 或 Windows 系统。</li>
        <li>
                树莓派镜像工具 :树莓派的官方开源工具,可以在你的 SD 卡上写入发行版镜像。</li>
        <li>
                Micro SD 卡:最低使用 16GB 的存储卡,推荐使用 32GB 的版本。</li>
        <li>
                一个基于 USB 的 Micro SD 卡读卡器(如果你的电脑没有读卡器)。</li>
        <li>
                树莓派 4 必备配件,如 HDMI 兼容显示器、Micro HDMI 连接到标准 HDMI(A/M) 接口的电缆、电源(建议使用官方适配器)、USB 的有线/无线键盘和鼠标/触摸板。</li>
</ol>
<p>
        最好能够提前 详细阅读树莓派的要求 。</p>
<p>
        现在,闲话少叙,让我快速带领你完成 SD 卡的镜像准备。</p>
<h3 class="mume-header" id="%E4%B8%BA%E6%A0%91%E8%8E%93%E6%B4%BE%E5%87%86%E5%A4%87-ubuntu-%E6%A1%8C%E9%9D%A2%E9%95%9C%E5%83%8F">
        为树莓派准备 Ubuntu 桌面镜像</h3>
<p>
        树莓派提供了一个 GUI 应用程序,用于将 ISO 镜像写入 SD 卡中。<strong>这个工具还可以自动下载兼容的操作系统,如 Ubuntu、树莓派操作系统等</strong>。</p>
<p class="article_img">
         </p>
<p>
        <img style="max-width:100%!important;height:auto!important;"title="如何在树莓派 4 上安装 Ubuntu 桌面系统" alt="如何在树莓派 4 上安装 Ubuntu 桌面系统" border="0" height="auto" src="https://zhuji.jb51.net/uploads/img/202305/38451d67b5607cb85e82335f3940e46e.jpg"></p>
<p class="article_img_desc">
        <em>下载并将操作系统放入 SD 卡的官方工具</em></p>
<p>
        你可以从官方网站上下载这个工具的 Ubuntu、Windows 和 macOS 版本:</p>
<ul>
<li>
                下载树莓派镜像工具</li>
</ul>
<p>
        在 Ubuntu 和其他 Linux 发行版上,你也可以使用 Snap 安装它:</p>
<ol class="linenums">
<li class="L0">
                <code><span class="kwd">sudo</span><span class="pln"> snap install rpi</span><span class="pun">-</span><span class="pln">imager</span></code>
</li>
</ol>
<p>
        安装完毕后,运行该工具。当你看到下面的界面时,选择 “<ruby>选择操作系统<rt>CHOOSE OS</rt></ruby>”:</p>
<p class="article_img">
         </p>
<p>
        <img style="max-width:100%!important;height:auto!important;"title="如何在树莓派 4 上安装 Ubuntu 桌面系统" alt="如何在树莓派 4 上安装 Ubuntu 桌面系统" border="0" height="auto" src="https://zhuji.jb51.net/uploads/img/202305/6e49e3f779288dff285980935269b613.jpg"></p>
<p class="article_img_desc">
        <em>镜像工具:选择首选操作系统</em></p>
<p>
        在“<ruby>操作系统<rt>Operating System</rt></ruby>”下,选择 “<ruby>其它通用的操作系统<rt>Other general purpose OS</rt></ruby>”:</p>
<p class="article_img">
         </p>
<p>
        <img style="max-width:100%!important;height:auto!important;"title="如何在树莓派 4 上安装 Ubuntu 桌面系统" alt="如何在树莓派 4 上安装 Ubuntu 桌面系统" border="0" height="auto" src="https://zhuji.jb51.net/uploads/img/202305/18b71292922d69ab86badb45544e1ee4.jpg"></p>
<p class="article_img_desc">
        <em>镜像工具: 其他通用的操作系统</em></p>
<p>
        现在,选择 “Ubuntu”:</p>
<p class="article_img">
         </p>
<p>
        <img style="max-width:100%!important;height:auto!important;"title="如何在树莓派 4 上安装 Ubuntu 桌面系统" alt="如何在树莓派 4 上安装 Ubuntu 桌面系统" border="0" height="auto" src="https://zhuji.jb51.net/uploads/img/202305/3547ce81254eebe2d041523b652f0086.jpg"></p>
<p class="article_img_desc">
        <em>镜像工具:发行版 - Ubuntu</em></p>
<p>
        接下来,选择 “Ubuntu Desktop 21.04(RPI 4/400)”,如下图所示。</p>
<p class="article_img">
         </p>
<p>
        <img style="max-width:100%!important;height:auto!important;"title="如何在树莓派 4 上安装 Ubuntu 桌面系统" alt="如何在树莓派 4 上安装 Ubuntu 桌面系统" border="0" height="auto" src="https://zhuji.jb51.net/uploads/img/202305/7898bd12e1852cae669b6e70709b0af4.jpg"></p>
<p class="article_img_desc">
        <em>镜像工具:发行版 - Ubuntu 21.04</em></p>
<blockquote>
        <p>
                <strong>注意:</strong></p>
        <p>
                如果你没有一个稳定的网络连接,你可以 从 Ubuntu 的网站上单独下载 Ubuntu 的树莓派镜像。在镜像工具中,在选择操作系统时,从底部选择“<ruby>使用自定义<rt>Use custom</rt></ruby>”选项。你也可以使用 Etcher 将镜像写入到 SD 卡上。</p>
</blockquote>
<p>
        将 Micro SD 卡插入读卡器中,等待它挂载。选择“<ruby>存储设备<rt>Storage</rt></ruby>”下的 “<ruby>选择存储设备<rt>CHOOSE STORAGE</rt></ruby>”:</p>
<p class="article_img">
         </p>
<p>
        <img style="max-width:100%!important;height:auto!important;"title="如何在树莓派 4 上安装 Ubuntu 桌面系统" alt="如何在树莓派 4 上安装 Ubuntu 桌面系统" border="0" height="auto" src="https://zhuji.jb51.net/uploads/img/202305/4c262b017b29875cd9bd4da50d357bbd.jpg"></p>
<p class="article_img_desc">
        <em>镜像工具:选择存储设备(SD 卡)</em></p>
<p>
        你应该可以根据存储空间大小,识别你的 Micro SD 卡。这里,我使用的是 32GB 的卡:</p>
<p class="article_img">
         </p>
<p>
        <img style="max-width:100%!important;height:auto!important;"title="如何在树莓派 4 上安装 Ubuntu 桌面系统" alt="如何在树莓派 4 上安装 Ubuntu 桌面系统" border="0" height="auto" src="https://zhuji.jb51.net/uploads/img/202305/49bc45312bc8ae5f617330888623b727.jpg"></p>
<p class="article_img_desc">
        <em>镜像工具:选择 SD 卡</em></p>
<p>
        现在点击“<ruby>写入<rt>WRITE</rt></ruby>”:</p>
<p class="article_img">
         </p>
<p>
        <img style="max-width:100%!important;height:auto!important;"title="如何在树莓派 4 上安装 Ubuntu 桌面系统" alt="如何在树莓派 4 上安装 Ubuntu 桌面系统" border="0" height="auto" src="https://zhuji.jb51.net/uploads/img/202305/980bf0309bdaf65863b38d147efd2fc8.jpg"></p>
<p class="article_img_desc">
        <em>镜像工具:镜像写入</em></p>
<p>
        如果你已经备份了 SD 卡上的内容或是一张新卡,你可以直接进行:</p>
<p class="article_img">
         </p>
<p>
        <img style="max-width:100%!important;height:auto!important;"title="如何在树莓派 4 上安装 Ubuntu 桌面系统" alt="如何在树莓派 4 上安装 Ubuntu 桌面系统" border="0" height="auto" src="https://zhuji.jb51.net/uploads/img/202305/0d88ff6efe94407d54b65e045d6701f1.jpg"></p>
<p class="article_img_desc">
        <em>镜像工具:镜像写入确认</em></p>
<p>
        由于这需要 sudo 的权限,你必须输入密码。如果你从终端运行 <code>sudo rpi-imager</code>,就不会出现这种情况:</p>
<p class="article_img">
         </p>
<p>
        <img style="max-width:100%!important;height:auto!important;"title="如何在树莓派 4 上安装 Ubuntu 桌面系统" alt="如何在树莓派 4 上安装 Ubuntu 桌面系统" border="0" height="auto" src="https://zhuji.jb51.net/uploads/img/202305/d0c345040b1706c38fcfa820c39b15f8.jpg" width="auto"></p>
<p class="article_img_desc">
        <em>镜像工具:镜像写入授权需要密码</em></p>
<p>
        如果你的 SD 卡有点旧,这将需要一些时间。如果它是一个新的高速 SD 卡,就无需很长时间:</p>
<p class="article_img">
         </p>
<p>
        <img style="max-width:100%!important;height:auto!important;"title="如何在树莓派 4 上安装 Ubuntu 桌面系统" alt="如何在树莓派 4 上安装 Ubuntu 桌面系统" border="0" height="auto" src="https://zhuji.jb51.net/uploads/img/202305/ce14333a42d3c28e1ee6818c0e1a0c88.jpg"></p>
<p class="article_img_desc">
        <em>镜像工具:写入镜像</em></p>
<p>
        为确保镜像写入成功,我不建议跳过验证:</p>
<p class="article_img">
         </p>
<p>
        <img style="max-width:100%!important;height:auto!important;"title="如何在树莓派 4 上安装 Ubuntu 桌面系统" alt="如何在树莓派 4 上安装 Ubuntu 桌面系统" border="0" height="auto" src="https://zhuji.jb51.net/uploads/img/202305/8fbc87fc74f7273d302a5597fd0fd2f2.jpg"></p>
<p class="article_img_desc">
        <em>镜像工具:验证写入</em></p>
<p>
        写入结束后,会有以下确认提示:</p>
<p class="article_img">
         </p>
<p>
        <img style="max-width:100%!important;height:auto!important;"title="如何在树莓派 4 上安装 Ubuntu 桌面系统" alt="如何在树莓派 4 上安装 Ubuntu 桌面系统" border="0" height="auto" src="https://zhuji.jb51.net/uploads/img/202305/646b8b30cfdc6a4a749ed69872cc5c4a.jpg"></p>
<p class="article_img_desc">
        <em>镜像工具:写入成功</em></p>
<p>
        现在,从你的系统中安全移除 SD 卡。</p>
<h3 class="mume-header" id="%E5%9C%A8%E6%A0%91%E8%8E%93%E6%B4%BE%E4%B8%8A%E4%BD%BF%E7%94%A8%E8%A3%85%E6%9C%89-ubuntu-%E7%9A%84-microsd-%E5%8D%A1">
        在树莓派上使用装有 Ubuntu 的 MicroSD 卡</h3>
<p>
        已经成功了一半了。与常规的 Ubuntu 安装不同,无需创建一个临场安装环境。Ubuntu 已经安装在 SD 卡上了,而且几乎可以直接使用了。让我们来看看这里还剩下什么。</p>
<h4 class="mume-header" id="%E7%AC%AC-1-%E6%AD%A5%E5%B0%86-sd-%E5%8D%A1%E6%8F%92%E5%85%A5%E6%A0%91%E8%8E%93%E6%B4%BE%E4%B8%AD">
        第 1 步:将 SD 卡插入树莓派中</h4>
<p>
        对于第一次使用的用户来说,有时会有点困惑,不知道那个卡槽到底在哪里?不用担心。它位于电路板背面的左手边。下面是一个插入卡后的倒置视图。</p>
<p class="article_img">
         </p>
<p>
        <img style="max-width:100%!important;height:auto!important;"title="如何在树莓派 4 上安装 Ubuntu 桌面系统" alt="如何在树莓派 4 上安装 Ubuntu 桌面系统" border="0" height="auto" src="https://zhuji.jb51.net/uploads/img/202305/46e3795915911400c02e4740d31c7a02.jpg"></p>
<p class="article_img_desc">
        <em>树莓派 4B 板倒置,插入 Micro SD 卡</em></p>
<p>
        按照这个方向将卡慢慢插入板子下面的卡槽,轻轻地插,直到它不再往前移动。你可能还会听到一点咔嚓声来确认。这意味着它已经完美地插入了。</p>
<p class="article_img">
         </p>
<p>
        <img style="max-width:100%!important;height:auto!important;"title="如何在树莓派 4 上安装 Ubuntu 桌面系统" alt="如何在树莓派 4 上安装 Ubuntu 桌面系统" border="0" height="auto" src="https://zhuji.jb51.net/uploads/img/202305/adabe87a888ebd03134887f59ba8a044.jpg"></p>
<p class="article_img_desc">
        <em>树莓派 SD 插槽在板子背面的左侧</em></p>
<p>
        当你把它插进去的时候,你可能会注意到在插槽中有两个小针脚调整了自己的位置(如上图所示),但这没关系。一旦插入,卡看起来会有一点突出。这就是它应该有的样子。</p>
<p class="article_img">
         </p>
<p>
        <img style="max-width:100%!important;height:auto!important;"title="如何在树莓派 4 上安装 Ubuntu 桌面系统" alt="如何在树莓派 4 上安装 Ubuntu 桌面系统" border="0" height="auto" src="https://zhuji.jb51.net/uploads/img/202305/35d287766c53bfbdd5711a37606507a1.jpg"></p>
<p class="article_img_desc">
        <em>树莓派 SD 卡插入时有一小部分可见</em></p>
<h4 class="mume-header" id="%E7%AC%AC-2-%E6%AD%A5%E8%AE%BE%E7%BD%AE%E6%A0%91%E8%8E%93%E6%B4%BE">
        第 2 步:设置树莓派</h4>
<p>
        我无需在这里详细介绍。</p>
<p>
        保证电源线接头、微型 HDMI 线接头、键盘和鼠标接头(有线/无线)都牢固地连接到树莓派板的相关端口。</p>
<p>
        确保显示器和电源插头也已正确连接,然后再去打开电源插座。我不建议把适配器插到带电的插座上。参考 电弧。</p>
<p>
        确认了以上两个步骤后,你就可以 打开树莓派设备的电源。</p>
<h4 class="mume-header" id="%E7%AC%AC-3-%E6%AD%A5%E5%9C%A8%E6%A0%91%E8%8E%93%E6%B4%BE%E4%B8%8A-ubuntu-%E6%A1%8C%E9%9D%A2%E7%9A%84%E9%A6%96%E6%AC%A1%E8%BF%90%E8%A1%8C">
        第 3 步:在树莓派上 Ubuntu 桌面的首次运行</h4>
<p>
        当你打开树莓派的电源,你需要在初次运行时进行一些基本配置。你只需按照屏幕上的指示操作即可。</p>
<p>
        选择你的语言、键盘布局、连接到 WiFi 等:</p>
<p class="article_img">
         </p>
<p>
        <img style="max-width:100%!important;height:auto!important;"title="如何在树莓派 4 上安装 Ubuntu 桌面系统" alt="如何在树莓派 4 上安装 Ubuntu 桌面系统" border="0" height="auto" src="https://zhuji.jb51.net/uploads/img/202305/c6fa038b98987c20ef7dcd7642cb34a9.jpg"></p>
<p class="article_img_desc">
        <em>选择语言</em></p>
<p class="article_img">
         </p>
<p>
        <img style="max-width:100%!important;height:auto!important;"title="如何在树莓派 4 上安装 Ubuntu 桌面系统" alt="如何在树莓派 4 上安装 Ubuntu 桌面系统" border="0" height="auto" src="https://zhuji.jb51.net/uploads/img/202305/83f5d12e5ef0f7e4f4583b0733f591cf.jpg"></p>
<p class="article_img_desc">
        <em>选择键盘布局</em></p>
<p class="article_img">
         </p>
<p>
        <img style="max-width:100%!important;height:auto!important;"title="如何在树莓派 4 上安装 Ubuntu 桌面系统" alt="如何在树莓派 4 上安装 Ubuntu 桌面系统" border="0" height="auto" src="https://zhuji.jb51.net/uploads/img/202305/7762d20f69b9e6d4adee67b4f6541762.jpg"></p>
<p class="article_img_desc">
        <em>选择 WiFi</em></p>
<p>
        你可以根据需求选择时区:</p>
<p class="article_img">
         </p>
<p>
        <img style="max-width:100%!important;height:auto!important;"title="如何在树莓派 4 上安装 Ubuntu 桌面系统" alt="如何在树莓派 4 上安装 Ubuntu 桌面系统" border="0" height="auto" src="https://zhuji.jb51.net/uploads/img/202305/c08f519fec1795e088b534cf8c265aa6.jpg"></p>
<p class="article_img_desc">
        <em>选择时区</em></p>
<p>
        然后创建用户和密码:</p>
<p class="article_img">
         </p>
<p>
        <img style="max-width:100%!important;height:auto!important;"title="如何在树莓派 4 上安装 Ubuntu 桌面系统" alt="如何在树莓派 4 上安装 Ubuntu 桌面系统" border="0" height="auto" src="https://zhuji.jb51.net/uploads/img/202305/b19d72772608f40aad653067d2381e62.jpg"></p>
<p class="article_img_desc">
        <em>输入所需的用户名和密码</em></p>
<p>
        之后的步骤将配置一些东西,这个过程需要一些时间:</p>
<p class="article_img">
         </p>
<p>
        <img style="max-width:100%!important;height:auto!important;"title="如何在树莓派 4 上安装 Ubuntu 桌面系统" alt="如何在树莓派 4 上安装 Ubuntu 桌面系统" border="0" height="auto" src="https://zhuji.jb51.net/uploads/img/202305/f9e9435f26f21b890384af201f449f69.jpg"></p>
<p class="article_img_desc">
        <em>完成 Ubuntu 设置</em></p>
<p class="article_img">
         </p>
<p>
        <img style="max-width:100%!important;height:auto!important;"title="如何在树莓派 4 上安装 Ubuntu 桌面系统" alt="如何在树莓派 4 上安装 Ubuntu 桌面系统" border="0" height="auto" src="https://zhuji.jb51.net/uploads/img/202305/ee0de5cc80b775202ddb512f16d435ca.jpg"></p>
<p class="article_img_desc">
        <em>完成 Ubuntu 设置</em></p>
<p>
        系统会重新启动之前需要一些时间,最终,你将会来到 Ubuntu 的登录界面:</p>
<p class="article_img">
         </p>
<p>
        <img style="max-width:100%!important;height:auto!important;"title="如何在树莓派 4 上安装 Ubuntu 桌面系统" alt="如何在树莓派 4 上安装 Ubuntu 桌面系统" border="0" height="auto" src="https://zhuji.jb51.net/uploads/img/202305/b57f46cb33076af70464a1823a02a418.jpg"></p>
<p class="article_img_desc">
        <em>Ubuntu 的登录界面</em></p>
<p>
        现在,你可以开始享受树莓派上的 Ubuntu 桌面了:</p>
<p class="article_img">
         </p>
<p>
        <img style="max-width:100%!important;height:auto!important;"title="如何在树莓派 4 上安装 Ubuntu 桌面系统" alt="如何在树莓派 4 上安装 Ubuntu 桌面系统" border="0" height="auto" src="https://zhuji.jb51.net/uploads/img/202305/7e31b9310342c39b787b49a5f8f0eace.jpg"></p>
<p class="article_img_desc">
        <em>树莓派上的 Ubuntu 桌面</em></p>
<h3 class="mume-header" id="%E6%80%BB%E7%BB%93">
        总结</h3>
<p>
        我注意到<strong>一个暂时的异常情况</strong>。在进行安装时,我的显示器左侧有一个红色的闪烁边界。这种闪烁(也有不同的颜色)在屏幕的随机部分也能注意到。但在重启和第一次启动后,它就消失了。</p>
<p>
        很高兴能够看到它在树莓派上运行,我非常需要 Ubuntu 开始为树莓派等流行的 ARM 设备提供支持。</p>
<p>
        原文链接:https://linux.cn/article-13817-1.html</p>
頁: [1]
查看完整版本: 如何在树莓派 4 上安装 Ubuntu 桌面系统