基于树莓派4B的Ubuntu-mate系统装机记录

笔者经过尝试raspbian、Ubuntu-desktop、Ubuntu-server、Ubuntu-core等系统的体验,最终选择了对内存要求不是太高,有图形界面的Ubuntu-mate 22.04LTS系统,跟raspbian很类似,没有多余的软件,内存占用1G左右,能作为基本的Linux主机使用。

一、下载Ubuntu系统镜像

Ubuntu官方链接:https://ubuntu.com/download/raspberry-pi

Ubuntu-mate官方链接:Choose an architecture | Download (ubuntu-mate.org) 

根据树莓派的硬件和需求选择相应系统镜像。

二、烧录系统镜像

准备TF卡,使用相关工具下载烧录,相关教程很多,这里不再赘述。

三、插卡开机

如果有HDMI接口的屏幕、鼠标,将简单许多,开机根据提示选择语言,时区,创建账户等,即完成开机初始化。

没有屏幕的只能使用SSH远程操控,相关教程也很多,笔者有外接屏幕并未尝试过。

四、最重要的安装必要的软件

1、换源。

原本的软件源远在国外,软件下载更新巨慢,第一步自然的换成国内源。听说中科大的源比较全面,经过体验速度也不错。

查看系统版本:

lsb_release -a

根据系统发行版版本,选择相应的源

如:

编辑源代码段:

sudo nano /etc/apt/sources.list

头部标‘#’注释原代码段,添加jammy的软件源

# 中科大源

deb https://mirrors.ustc.edu.cn/ubuntu-ports-ports/ jammy main restricted universe multiverse
deb-src https://mirrors.ustc.edu.cn/ubuntu-ports/ jammy main restricted universe multiverse
deb https://mirrors.ustc.edu.cn/ubuntu-ports/ jammy-updates main restricted universe multiverse
deb-src https://mirrors.ustc.edu.cn/ubuntu-ports/ jammy-updates main restricted universe multiverse
deb https://mirrors.ustc.edu.cn/ubuntu-ports/ jammy-backports main restricted universe multiverse
deb-src https://mirrors.ustc.edu.cn/ubuntu-ports/ jammy-backports main restricted universe multiverse
deb https://mirrors.ustc.edu.cn/ubuntu-ports/ jammy-security main restricted universe multiverse
deb-src https://mirrors.ustc.edu.cn/ubuntu-ports/ jammy-security main restricted universe multiverse
deb https://mirrors.ustc.edu.cn/ubuntu-ports/ jammy-proposed main restricted universe multiverse
deb-src https://mirrors.ustc.edu.cn/ubuntu-ports/ jammy-proposed main restricted universe multiverse

完成后ctrl+o保存,ctrl+x退出,在终端输入以下指令更新软件:

sudo apt update 			// 更新apt资源列表
sudo apt upgrade            // 更新软件

2.开启SSH服务。

通常来说有时还是需要用PC电脑操控的。

sudo apt update 			        //更新apt资源
sudo apt install openssh-server		//安装ssh
sudo service ssh start			    //启动ssh,这里就可以通过ssh连接了
sudo systemctl enable ssh 		    //将ssh服务设置为用户登录时启动。
sudo ufw allow ssh			        //开启SSH服务器的防火墙

PC端在Ubuntu系统中就可以使用:

ssh 用户名@树莓派IP地址

来登陆,Windows系统可查询网络教程,来连接。。。

3.安装samba,开启文件共享。

官方教程:Install and Configure Samba | Ubuntu

以下是从文档中复制来的:

To install Samba, we run:

sudo apt update
sudo apt install samba

We can check if the installation was successful by running:

whereis samba

Now that Samba is installed, we need to create a directory for it to share:

mkdir /home/<username>/sambashare/    // <username>换成自己的树莓派用户名,可自定义

The command above creates a new folder sambashare in our home directory which we will share later.

The configuration file for Samba is located at /etc/samba/smb.conf. To add the new directory as a share, we edit the file by running:

sudo vim /etc/samba/smb.conf

At the bottom of the file, add the following lines:

[sambashare]
    comment = Samba on Ubuntu
    path = /home/username/sambashare
    read only = no
    browsable = yes

Now that we have our new share configured, save it and restart Samba for it to take effect:

sudo service smbd restart

Update the firewall rules to allow Samba traffic:

sudo ufw allow samba

Since Samba doesn’t use the system account password, we need to set up a Samba password for our user account:

sudo smbpasswd -a username        // username换成自己的树莓派用户名 

On Windows, open up File Manager and edit the file path to:

\\ip-address\sambashare        // ip-address 替换为树莓派ip地址

4.安装中文输入法。

笔者为此困扰了很久,翻遍了很多教程,最终才得以解决。

如果安装了fcitx框架,却没有中文输入法,则可按以下步骤:

打开终端,输入以下命令以卸载 fcitx4 相关软件包:

sudo apt-get remove fcitx*

输入以下命令以更新系统软件包:

sudo apt-get update

输入以下命令以安装 fcitx5 相关软件包:

sudo apt-get install fcitx5

输入以下命令安装 fcitx5 中文输入法(也可安装谷歌拼音,参考网上教程):

sudo apt-get install fcitx5-pinyin

5.安装树莓派gpio库

这里给出bcm2835库的安装,适用于C/C++开发使用

官方链接:http://www.airspayce.com/mikem/bcm2835/

相关教程也可参考以上链接文档,相关安装命令如下:

# download the latest version of the library, say bcm2835-1.xx.tar.gz, then:
tar zxvf bcm2835-1.xx.tar.gz
cd bcm2835-1.xx
./configure
make
sudo make check
sudo make install

五、总结

之后还应该安装文本编辑器,网上都推荐Vim,但作为Linux小白,实在难以配置出好看又好用的Vim界面,最终还是安装了一个VScode,不用配置既有良好的编辑环境,虽然内存占用确实较高,但还是省心的。目前树莓派只能作为Linux小电脑使用,学习一下Linux终端命令行,和设备驱动,真要做嵌入式还得将树莓派做下位机,安装Ubuntu-core系统比较合适。

千淘万漉虽辛苦,吹尽狂沙始到金。

### 回答1: 您可以通过以下步骤安装Ubuntu mate系统: 1. 下载Ubuntu mate系统的镜像文件并解压缩。 2. 使用SD卡制作工具将Ubuntu mate系统写入SD卡中。 3. 将SD卡插入树莓派4b中并启动设备。 4. 根据提示进行安装即可。 希望这个回答能够帮到您。 ### 回答2: 安装Ubuntu Mate系统树莓派4B可以按照以下步骤进行: 1. 首先,从Ubuntu Mate官方网站上下载适用于树莓派4B的镜像文件。可以选择64位版本的镜像。 2. 下载完成后,使用一个镜像烧录软件将镜像文件写入一个SD卡上。常用的烧录软件有Etcher和Win32DiskImager等。 3. 在烧录完成后,将SD卡插入到树莓派4B的SD卡槽中。 4. 连接树莓派4B到显示器和键盘。使用HDMI接口将树莓派连接到显示器,并插入键盘到USB接口。 5. 接下来,连接树莓派4B到电源开启它。系统将会自动引导。 6. 在首次引导过程中,您将会被引导设置您的系统语言、键盘布局和网络连接。 7. 完成这些设置后,将进入到Ubuntu Mate桌面环境。您可以使用鼠标和键盘进行操作。 8. 进入桌面后,您可以根据需要进行个性化设置和配置,安装额外的软件和更新系统。 总结一下,安装Ubuntu Mate系统树莓派4B相对简单。只需下载镜像文件,烧录到SD卡上,插入SD卡到树莓派并连接显示器和键盘,然后引导树莓派进行初次设置即可。之后您就可以在Ubuntu Mate桌面环境中使用树莓派4B了。 ### 回答3: 树莓派4b是一款强大的单板计算机,它可以运行多种操作系统,包括Ubuntu Mate。以下是安装Ubuntu Mate系统的步骤: 1. 首先,准备一个SD卡,至少为16GB,推荐使用32GB或64GB的高速SD卡。确保SD卡已经格式化为FAT32文件系统。 2. 下载Ubuntu Mate的镜像文件。在官方网站上可以找到树莓派的专属版本。下载完后,将镜像文件保存在本地。 3. 安装一个专用的SD卡写入工具,如Etcher。打开Etcher并选择刚刚下载的Ubuntu Mate镜像文件。 4. 插入SD卡到计算机的SD卡读卡器中,并在Etcher中选择对应的SD卡。 5. 单击“Flash!”按钮,Etcher将开始将Ubuntu Mate系统写入SD卡。这个过程可能需要几分钟的时间。 6. 写入完成后,将SD卡插入树莓派的SD卡插槽中。 7. 连接显示器、键盘和鼠标到树莓派上,并插入电源。 8. 树莓派启动后,选择Ubuntu Mate作为默认操作系统树莓派将自动安装和配置Ubuntu Mate系统。 9. 根据系统提示,设置用户名和密码。 10. 完成设置后,你将能够访问Ubuntu Mate桌面。享受树莓派Ubuntu Mate带来的强大功能和灵活性! 总之,安装Ubuntu Mate系统非常简单。只需准备好SD卡、下载镜像文件、写入SD卡并启动树莓派,就能够轻松使用树莓派4b的Ubuntu Mate系统了。
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值