树莓派4b安装ubuntu-18.04.3教程(2019.8.17)

最新版的树莓派4b今年6月末发布,目前只有官方的Raspbian-Buster系统支持,其他系统均只支持到树莓派3b+,这对于树莓派4b的玩家非常不方便,所以下面教大家如何修改配置文件,使得ubuntu也能够在树莓派4b上运行。

本文已经搬到CSDN上了,排版舒服一点,传送门 :树莓派4b安装ubuntu-18.04.3教程(2019.8.17)

树莓派 4B 安装 Ubuntu 19.10 ,传送门 :树莓派 4B 安装 Ubuntu 19.10 (Eoan Ermine) IOT 版

最新的镜像安装已经整理到CSDN上,传送门:树莓派 4B 安装 Ubuntu 18.04.4 LTS (or)Ubuntu 19.10

人脸识别并不是什么高大上的东西,入门人脸识别,内容包括硬件配置,环境搭载,代码详解,程序部署,传送门:树莓派4b之初学者入门人脸识别

一、安装

本文用的是32G内存卡,安装ubuntu-18.04.3-preinstalled-server-armhf+raspi3系统,是32位系统,64位系统安装之后会有内存限制,所以目前还没有去安装。

下载镜像,选择 ubuntu-18.04.3-preinstalled-server-armhf+raspi3.img.xz 的镜像进行下载
从官方下载镜像:https://wiki.ubuntu.com/ARM/RaspberryPi
或者从这里下载: http://cdimage.ubuntu.com/releases/18.04/release/

从官方下载树莓派4b的Boot引导:https://github.com/raspberrypi/firmware

以上的文件都已经上传到百度网盘:
链接:https://pan.baidu.com/s/1N4qG6ZZNE18GFhYcaj85hA
提取码:x572

工具准备:

大于8G的内存卡
Win32DiskImager
ubuntu-18.04.3-preinstalled-server-armhf+raspi3.img
firmware-master.zip

首先把下载好的镜像用Win32DiskImager烧录到准备好的U盘里面,用其它烧录软件都可以。


image.png

烧录完成之后,打开U盘,把里面的文件全部删除,再将从firmware-master.zip中解压得到的Boot文件夹里面的所有文件复制到U盘里面,这样树莓派3b+的boot文件被替换成树莓派4b的boot文件,
替换前:


image.png

替换后


image.png

在U盘根目录下创建两个文件(cmdline.txt和config.txt),并分别复制相应的内容,写入文件并保存,也可以将百度网盘已经写好的文件下载后拷贝到U盘根目录。
创建cmdline.txt ,将下面的内容复制到文件里面并保存

dwc_otg.fiq_fix_enable=2 console=ttyAMA0,115200 kgdboc=ttyAMA0,115200 console=tty1 root=/dev/mmcblk0p2 rootfstype=ext4 rootwait rootflags=noload net.ifnames=0

创建config.txt,将下面的内容复制到文件里面并保存

# Enable audio (loads snd_bcm2835)
dtparam=audio=on

[pi4]

[all]

同时,记得创建一个空文件,改名为SSH(不要有文件后缀名.txt),放到U盘根目录,开启SSH远程登录,如果安装之后没法进入系统,没关系,用远程登录即可。

到目前为止,就可以将内存卡插入到你的树莓派4b,启动系统了,首次启动时间比较长,需要2-3分钟,请耐心等待。

默认的登陆用户名和密码都为:ubuntu

其他具体内容可以参考来源:https://jamesachambers.com/raspberry-pi-ubuntu-server-18-04-2-installation-guide/

二、换源

先执行一下sudo apt-get update看是否能够成功,如果成功,等待更新完成,不会太久,确定能构正常更新,就执行一下步骤进行换源

sudo nano /etc/apt/sources.list

## Note, this file is written by cloud-init on first boot of an instance
## modifications made here will not survive a re-bundle.
## if you wish to make changes you can:
## a.) add 'apt_preserve_sources_list: true' to /etc/cloud/cloud.cfg
## or do the same in user-data
## b.) add sources in /etc/apt/sources.list.d
## c.) make changes to template file /etc/cloud/templates/sources.list.tmpl

# See http://help.ubuntu.com/community/UpgradeNotes for how to upgrade to
# newer versions of the distribution.
deb https://mirrors.tuna.tsinghua.edu.cn/ubuntu-ports bionic main restricted
deb-src https://mirrors.tuna.tsinghua.edu.cn/ubuntu-ports bionic main restricted

## Major bug fix updates produced after the final release of the
## distribution.
deb https://mirrors.tuna.tsinghua.edu.cn/ubuntu-ports bionic-updates main restricted
deb-src https://mirrors.tuna.tsinghua.edu.cn/ubuntu-ports bionic-updates main restricted

## N.B. software from this repository is ENTIRELY UNSUPPORTED by the Ubuntu
## team. Also, please note that software in universe WILL NOT receive any
## review or updates from the Ubuntu security team.
deb https://mirrors.tuna.tsinghua.edu.cn/ubuntu-ports bionic universe
deb-src https://mirrors.tuna.tsinghua.edu.cn/ubuntu-ports bionic universe
deb https://mirrors.tuna.tsinghua.edu.cn/ubuntu-ports bionic-updates universe
deb-src https://mirrors.tuna.tsinghua.edu.cn/ubuntu-ports bionic-updates universe

## N.B. software from this repository is ENTIRELY UNSUPPORTED by the Ubuntu
## team, and may not be under a free licence. Please satisfy yourself as to
## your rights to use the software. Also, please note that software in
## multiverse WILL NOT receive any review or updates from the Ubuntu
## security team.
deb https://mirrors.tuna.tsinghua.edu.cn/ubuntu-ports bionic multiverse
deb-src https://mirrors.tuna.tsinghua.edu.cn/ubuntu-ports bionic multiverse
deb https://mirrors.tuna.tsinghua.edu.cn/ubuntu-ports bionic-updates multiverse
deb-src https://mirrors.tuna.tsinghua.edu.cn/ubuntu-ports bionic-updates multiverse

## N.B. software from this repository may not have been tested as
## extensively as that contained in the main release, although it includes
## newer versions of some applications which may provide useful features.
## Also, please note that software in backports WILL NOT receive any review
## or updates from the Ubuntu security team.
deb https://mirrors.tuna.tsinghua.edu.cn/ubuntu-ports bionic-backports main restricted universe multiverse
deb-src https://mirrors.tuna.tsinghua.edu.cn/ubuntu-ports bionic-backports main restricted universe multiverse

deb https://mirrors.tuna.tsinghua.edu.cn/ubuntu-ports bionic-security main restricted
deb-src https://mirrors.tuna.tsinghua.edu.cn/ubuntu-ports bionic-security main restricted
deb https://mirrors.tuna.tsinghua.edu.cn/ubuntu-ports bionic-security universe
deb-src https://mirrors.tuna.tsinghua.edu.cn/ubuntu-ports bionic-security universe
deb https://mirrors.tuna.tsinghua.edu.cn/ubuntu-ports bionic-security multiverse
deb-src https://mirrors.tuna.tsinghua.edu.cn/ubuntu-ports bionic-security multiverse

## Uncomment the following two lines to add software from Canonical's
## 'partner' repository.
## This software is not part of Ubuntu, but is offered by Canonical and the
## respective vendors as a service to Ubuntu users.
# deb http://archive.canonical.com/ubuntu bionic partner
# deb-src http://archive.canonical.com/ubuntu bionic partner

换源之后记得更新一下

sudo apt update
sudo apt upgrade

如果安装更新的的时候出现错误:dpkg returned an error code (1)
执行下面的语句
进入目录

cd /var/lib/dpkg

删除文件

sudo mv info info.baksudo

重新创建,到此解决错误问题

sudo mkdir info

然后再重新执行上面的更新

一定要保证源的替换是正确的,不能缺少,否则会出现找不到安装包的问题哦,小编之前就是源的替换少了一个,所以安装软件的时候会出现找不到合适的安装包
安装桌面的时候,会出现依赖的问题,先安装aptitude,用aptitude能够自动安装所缺失的依赖

sudo apt-get install aptitude

喜欢桌面操作的可以安装官方推荐的桌面,以下三个安装其中一个即可:

sudo aptitude install xubuntu-desktop
sudo aptitude install lubuntu-desktop
sudo aptitude install kubuntu-desktop

三、使用xrdp远程桌面连接

sudo apt-get install tightvncserver xrdp

安装完后,执行以下指令


echo xfce4-session >~/.xsession

将xfce4-session写入到文件.xsession中

修改 /etc/xrdp/startwm.sh 文件

sudo nano /etc/xrdp/startwm.sh

在 /etc/X11/Xsession 上边添加 xfce4-session


image.png

修改配置文件 /etc/X11/Xsession

sudo nano /etc/X11/Xsession

在文件最上面添加 xfce4-session

image.png

重新启动xrdp服务

sudo service xrdp restart

然后我们就可以使用Windows的mstsc登录了,界面如下

image.png
image.png
image.png
最后编辑于
©著作权归作者所有,转载或内容合作请联系作者
  • 序言:七十年代末,一起剥皮案震惊了整个滨河市,随后出现的几起案子,更是在滨河造成了极大的恐慌,老刑警刘岩,带你破解...
    沈念sama阅读 194,524评论 5 460
  • 序言:滨河连续发生了三起死亡事件,死亡现场离奇诡异,居然都是意外死亡,警方通过查阅死者的电脑和手机,发现死者居然都...
    沈念sama阅读 81,869评论 2 371
  • 文/潘晓璐 我一进店门,熙熙楼的掌柜王于贵愁眉苦脸地迎上来,“玉大人,你说我怎么就摊上这事。” “怎么了?”我有些...
    开封第一讲书人阅读 141,813评论 0 320
  • 文/不坏的土叔 我叫张陵,是天一观的道长。 经常有香客问我,道长,这世上最难降的妖魔是什么? 我笑而不...
    开封第一讲书人阅读 52,210评论 1 263
  • 正文 为了忘掉前任,我火速办了婚礼,结果婚礼上,老公的妹妹穿的比我还像新娘。我一直安慰自己,他们只是感情好,可当我...
    茶点故事阅读 61,085评论 4 355
  • 文/花漫 我一把揭开白布。 她就那样静静地躺着,像睡着了一般。 火红的嫁衣衬着肌肤如雪。 梳的纹丝不乱的头发上,一...
    开封第一讲书人阅读 46,117评论 1 272
  • 那天,我揣着相机与录音,去河边找鬼。 笑死,一个胖子当着我的面吹牛,可吹牛的内容都是我干的。 我是一名探鬼主播,决...
    沈念sama阅读 36,533评论 3 381
  • 文/苍兰香墨 我猛地睁开眼,长吁一口气:“原来是场噩梦啊……” “哼!你这毒妇竟也来了?” 一声冷哼从身侧响起,我...
    开封第一讲书人阅读 35,219评论 0 253
  • 序言:老挝万荣一对情侣失踪,失踪者是张志新(化名)和其女友刘颖,没想到半个月后,有当地人在树林里发现了一具尸体,经...
    沈念sama阅读 39,487评论 1 290
  • 正文 独居荒郊野岭守林人离奇死亡,尸身上长有42处带血的脓包…… 初始之章·张勋 以下内容为张勋视角 年9月15日...
    茶点故事阅读 34,582评论 2 309
  • 正文 我和宋清朗相恋三年,在试婚纱的时候发现自己被绿了。 大学时的朋友给我发了我未婚夫和他白月光在一起吃饭的照片。...
    茶点故事阅读 36,362评论 1 326
  • 序言:一个原本活蹦乱跳的男人离奇死亡,死状恐怖,灵堂内的尸体忽然破棺而出,到底是诈尸还是另有隐情,我是刑警宁泽,带...
    沈念sama阅读 32,218评论 3 312
  • 正文 年R本政府宣布,位于F岛的核电站,受9级特大地震影响,放射性物质发生泄漏。R本人自食恶果不足惜,却给世界环境...
    茶点故事阅读 37,589评论 3 299
  • 文/蒙蒙 一、第九天 我趴在偏房一处隐蔽的房顶上张望。 院中可真热闹,春花似锦、人声如沸。这庄子的主人今日做“春日...
    开封第一讲书人阅读 28,899评论 0 17
  • 文/苍兰香墨 我抬头看了看天上的太阳。三九已至,却和暖如春,着一层夹袄步出监牢的瞬间,已是汗流浃背。 一阵脚步声响...
    开封第一讲书人阅读 30,176评论 1 250
  • 我被黑心中介骗来泰国打工, 没想到刚下飞机就差点儿被人妖公主榨干…… 1. 我叫王不留,地道东北人。 一个月前我还...
    沈念sama阅读 41,503评论 2 341
  • 正文 我出身青楼,却偏偏与公主长得像,于是被迫代替她去往敌国和亲。 传闻我的和亲对象是个残疾皇子,可洞房花烛夜当晚...
    茶点故事阅读 40,707评论 2 335