測試在樹莓派上使用Ubuntu 20.04的桌面版

Ubuntu 20.04 LST 

到官網下載 Ubuntu Server image檔
https://ubuntu.com/download/raspberry-pi

Format microSD card 

透過SD Card Formatter格式化為MS-DOS(FAT)

Create a Bootable microSD card 

以下在MacOS上做示範

把剛剛下載好的Ubuntu image放在 ~/Downloads

打開終端機

diskutil list

查看microSD的硬碟代號

/dev/disk0 (internal, physical):
   #:                       TYPE NAME                    SIZE       IDENTIFIER
   0:      GUID_partition_scheme                        *251.0 GB   disk0
   1:                        EFI EFI                     209.7 MB   disk0s1
   2:                 Apple_APFS Container disk1         250.8 GB   disk0s2

/dev/disk1 (synthesized):
   #:                       TYPE NAME                    SIZE       IDENTIFIER
   0:      APFS Container Scheme -                      +250.8 GB   disk1
                                 Physical Store disk0s2
   1:                APFS Volume Macintosh HD            204.2 GB   disk1s1
   2:                APFS Volume Preboot                 45.9 MB    disk1s2
   3:                APFS Volume Recovery                522.7 MB   disk1s3
   4:                APFS Volume VM                      3.2 GB     disk1s4

/dev/disk2
#:     TYPE NAME                       SIZE         IDENTIFIER
0:     FDisk_partition_scheme         *31.9 GB          disk2
1:     DOS_FAT_32 NO NAME              31.9 GB          disk2s1

所以/dev/disk2是我的microSD card

Unmount the microSD card

diskutil unmountDisk /dev/disk2

You will see

Unmount of all volumes on /dev/disk2 was successful

Copy the image to the microSD card

sudo sh -c 'gunzip -c ~/Downloads/ubuntu-20.04-preinstalled-server-arm64+raspi.img.xz | sudo dd of=/dev/disk2 bs=32m'

When finalised you will see

3719+1 records in
3719+1 records out
3899999744 bytes transferred in 642.512167 secs (6069924 bytes/sec)

Configuration Before Boot 

編輯config.txt
官方文獻: https://www.raspberrypi.org/documentation/configuration/config-txt/

設定overclock 讓rpi可以充分發揮它的效能

over_voltage=4
arm_freq=2000
gpu_freq=650

HDMI輸出設定

hdmi_force_hotplug=1
hdmi_ignore_edid=0xa5000080
config_hdmi_boost=4

讓audio ouput不要從HDMI出來 而是從3.5mm

hdmi_ignore_edid_audio=1

退出microSD 放到rpi裡面
確定接上HDMI cable再啟動電源

First Boot 

開機前 把乙太網路插好 可以省下設定無線網路卡的麻煩
第一次開機後的登入帳號密碼為 : ubuntu/ubuntu 登入後會要求立即變更密碼

然後依下面方式新增帳號, 並將原本的ubuntu帳號刪除

sudo useradd -m -s /bin/bash youraccount
sudo passwd youraccount
sudo adduser youraccount sudo
logout後, 使用新帳號登入
sudo userdel -r ubuntu

更新系統 

sudo apt-get update
sudo apt-get upgrade
sudo apt-get dist-upgrade

下載網路時間伺服器

sudo apt-get install ntp

到目前為止 Ubuntu Server版本已安裝完成
只有文字介面

Install Ubuntu Desktop 

若想當成desktop來使用的話 就必需再安裝桌面程式 目前可用的桌面程式有
ubuntu-desktop, kubuntu-desktop, lubuntu-desktop, xubuntu-desktop, ubuntu-mate-desktop

kubuntu跑不太動 不建議安裝
xubuntu跟lubuntu是輕量級的版本 但韌體比較舊

我自己是裝 ubuntu-desktop

sudo apt-get install ubuntu-desktop

Bluetooth 

Raspberry Pi 4 B Ubuntu Bluetooth not working / detected

Method 0:

hcitool dev
sudo systemctl restart bluetooth
systemctl status bluetooth
sudo add-apt-repository ppa:bluetooth/bluez
sudo apt install bluez

Method 1:

sudo apt install unity-control-center

Method 2:

sudo vim /boot/firmware/syscfg.txt
# include nobtcfg.txt
include btcfg.txt

Install pi-bluetooth

sudo apt-get install pi-bluetooth

exFAT 

Problem mounting exFAT disk on Ubuntu

sudo apt install exfat-fuse exfat-utils

su: Authentication failure 

sudo passwd root
Enter new UNIX password: 
Retype new UNIX password: 
passwd: password updated successfully

實測結果 

果然2000多塊錢的電腦是無法取代普通PC的
開瀏覽器看YouTube的影片720p就有些吃力了 有fps跑不順的狀況
我沒有裝Raspbian比較過 但xubuntu-desktop跑起來會比ubuntu-desktop來得順很多

還有另一個問題是輸出的畫面有時候暗掉 會變一格一格的像素
滑鼠游標移過去的地方才會再顯現 :'(
Imgur