最新版的樹莓派4b今年6月末發(fā)布缘滥,目前只有官方的Raspbian-Buster系統(tǒng)支持轰胁,其他系統(tǒng)均只支持到樹莓派3b+,這對于樹莓派4b的玩家非常不方便朝扼,所以下面教大家如何修改配置文件赃阀,使得ubuntu也能夠在樹莓派4b上運(yùn)行。
本文已經(jīng)搬到CSDN上了擎颖,排版舒服一點榛斯,傳送門 :樹莓派4b安裝ubuntu-18.04.3教程(2019.8.17)
樹莓派 4B 安裝 Ubuntu 19.10 ,傳送門 :樹莓派 4B 安裝 Ubuntu 19.10 (Eoan Ermine) IOT 版
最新的鏡像安裝已經(jīng)整理到CSDN上搂捧,傳送門:樹莓派 4B 安裝 Ubuntu 18.04.4 LTS (or)Ubuntu 19.10
人臉識別并不是什么高大上的東西驮俗,入門人臉識別,內(nèi)容包括硬件配置允跑,環(huán)境搭載王凑,代碼詳解,程序部署聋丝,傳送門:樹莓派4b之初學(xué)者入門人臉識別
一索烹、安裝
本文用的是32G內(nèi)存卡,安裝ubuntu-18.04.3-preinstalled-server-armhf+raspi3系統(tǒng)潮针,是32位系統(tǒng)术荤,64位系統(tǒng)安裝之后會有內(nèi)存限制,所以目前還沒有去安裝每篷。
下載鏡像瓣戚,選擇 ubuntu-18.04.3-preinstalled-server-armhf+raspi3.img.xz 的鏡像進(jìn)行下載
從官方下載鏡像:https://wiki.ubuntu.com/ARM/RaspberryPi
或者從這里下載: http://cdimage.ubuntu.com/releases/18.04/release/
從官方下載樹莓派4b的Boot引導(dǎo):https://github.com/raspberrypi/firmware
以上的文件都已經(jīng)上傳到百度網(wǎng)盤:
鏈接:https://pan.baidu.com/s/1N4qG6ZZNE18GFhYcaj85hA
提取碼:x572
工具準(zhǔn)備:
大于8G的內(nèi)存卡
Win32DiskImager
ubuntu-18.04.3-preinstalled-server-armhf+raspi3.img
firmware-master.zip
首先把下載好的鏡像用Win32DiskImager燒錄到準(zhǔn)備好的U盤里面端圈,用其它燒錄軟件都可以。
燒錄完成之后子库,打開U盤舱权,把里面的文件全部刪除,再將從firmware-master.zip中解壓得到的Boot文件夾里面的所有文件復(fù)制到U盤里面仑嗅,這樣樹莓派3b+的boot文件被替換成樹莓派4b的boot文件宴倍,
替換前:
替換后
在U盤根目錄下創(chuàng)建兩個文件(cmdline.txt和config.txt),并分別復(fù)制相應(yīng)的內(nèi)容仓技,寫入文件并保存鸵贬,也可以將百度網(wǎng)盤已經(jīng)寫好的文件下載后拷貝到U盤根目錄。
創(chuàng)建cmdline.txt ,將下面的內(nèi)容復(fù)制到文件里面并保存
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
創(chuàng)建config.txt脖捻,將下面的內(nèi)容復(fù)制到文件里面并保存
# Enable audio (loads snd_bcm2835)
dtparam=audio=on[pi4]
[all]
同時阔逼,記得創(chuàng)建一個空文件,改名為SSH(不要有文件后綴名.txt)地沮,放到U盤根目錄嗜浮,開啟SSH遠(yuǎn)程登錄,如果安裝之后沒法進(jìn)入系統(tǒng)摩疑,沒關(guān)系危融,用遠(yuǎn)程登錄即可。
到目前為止雷袋,就可以將內(nèi)存卡插入到你的樹莓派4b吉殃,啟動系統(tǒng)了,首次啟動時間比較長,需要2-3分鐘片排,請耐心等待寨腔。
默認(rèn)的登陸用戶名和密碼都為:ubuntu
其他具體內(nèi)容可以參考來源:https://jamesachambers.com/raspberry-pi-ubuntu-server-18-04-2-installation-guide/
二、換源
先執(zhí)行一下sudo apt-get update看是否能夠成功率寡,如果成功迫卢,等待更新完成,不會太久冶共,確定能構(gòu)正常更新乾蛤,就執(zhí)行一下步驟進(jìn)行換源
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 multiversedeb 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
如果安裝更新的的時候出現(xiàn)錯誤:dpkg returned an error code (1)
執(zhí)行下面的語句
進(jìn)入目錄
cd /var/lib/dpkg
刪除文件
sudo mv info info.baksudo
重新創(chuàng)建,到此解決錯誤問題
sudo mkdir info
然后再重新執(zhí)行上面的更新
一定要保證源的替換是正確的捅僵,不能缺少家卖,否則會出現(xiàn)找不到安裝包的問題哦,小編之前就是源的替換少了一個庙楚,所以安裝軟件的時候會出現(xiàn)找不到合適的安裝包
安裝桌面的時候上荡,會出現(xiàn)依賴的問題,先安裝aptitude,用aptitude能夠自動安裝所缺失的依賴
sudo apt-get install aptitude
喜歡桌面操作的可以安裝官方推薦的桌面酪捡,以下三個安裝其中一個即可:
sudo aptitude install xubuntu-desktop
sudo aptitude install lubuntu-desktop
sudo aptitude install kubuntu-desktop
三叁征、使用xrdp遠(yuǎn)程桌面連接
sudo apt-get install tightvncserver xrdp
安裝完后,執(zhí)行以下指令
echo xfce4-session >~/.xsession
將xfce4-session寫入到文件.xsession中
修改 /etc/xrdp/startwm.sh 文件
sudo nano /etc/xrdp/startwm.sh
在 /etc/X11/Xsession 上邊添加 xfce4-session
修改配置文件 /etc/X11/Xsession
sudo nano /etc/X11/Xsession
在文件最上面添加 xfce4-session
重新啟動xrdp服務(wù)
sudo service xrdp restart
然后我們就可以使用Windows的mstsc登錄了逛薇,界面如下