树莓派官方的Raspbian为了保持向下兼容仍然是32位,64位的树莓派3不跑64位系统和咸鱼有什么区别?

下载镜像

Ubuntu官方已经提供了树莓派3的镜像,直接下载即可。

刷TF卡

如果打算玩docker建议至少32G以上,16G需要在调试的间隙清理掉无用的若干<none>容器和镜像以免空间不足。刷TF卡用Etcher即可。
默认用户名和密码均为ubuntu

改源

1
sudo vi /etc/apt/sources.list

旧的源是http://ports.ubuntu.com,批量改成科大源并注释掉deb-src

1
2
:%s/http:\/\/ports.ubuntu.com/https:\/\/mirrors.ustc.edu.cn/g
:%s/deb-src/#deb-src/g

设置wifi

1
2
3
sudo apt install network-manager
sudo service network-manager start
sudo nmtui

debug

Unable to acquire the dpkg frontend lock (/var/lib/dpkg/lock-frontend), is another process using it?

1
2
3
sudo rm /var/lib/dpkg/lock*
sudo dpkg --configure -a
sudo apt update

dpkg: error: parsing file ‘/var/lib/dpkg/updates/0004’ near line 0

1
2
cd /var/lib/dpkg/updates && sudo rm -rf 0004
sudo dpkg --configure -a

简单测试

1
2
sudo apt install sysbench
sysbench --test=cpu --cpu-max-prime=20000 run

树莓派3B(BCM2837)测试结果:

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
sysbench 1.0.11 (using system LuaJIT 2.1.0-beta3)

Running the test with following options:
Number of threads: 1
Initializing random number generator from current time


Prime numbers limit: 20000

Initializing worker threads...

Threads started!

CPU speed:
events per second: 220.37

General statistics:
total time: 10.0007s
total number of events: 2206

Latency (ms):
min: 4.21
avg: 4.53
max: 8.78
95th percentile: 8.58
sum: 9996.78

Threads fairness:
events (avg/stddev): 2206.0000/0.00
execution time (avg/stddev): 9.9968/0.00

i5-8400用qemu模拟aarch64架构在ubuntu 16.04下测试结果:

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
sysbench 0.4.12:  multi-threaded system evaluation benchmark

Running the test with following options:
Number of threads: 1

Doing CPU performance benchmark

Threads started!
Done.

Maximum prime number checked in CPU test: 20000


Test execution summary:
total time: 45.2990s
total number of events: 10000
total time taken by event execution: 45.2838
per-request statistics:
min: 4.42ms
avg: 4.53ms
max: 5.26ms
approx. 95 percentile: 4.62ms

Threads fairness:
events (avg/stddev): 10000.0000/0.00
execution time (avg/stddev): 45.2838/0.00

i5-8400在ubuntu 18.04下测试结果:

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
sysbench 1.0.11 (using system LuaJIT 2.1.0-beta3)

Running the test with following options:
Number of threads: 1
Initializing random number generator from current time


Prime numbers limit: 20000

Initializing worker threads...

Threads started!

CPU speed:
events per second: 549.44

General statistics:
total time: 10.0018s
total number of events: 5496

Latency (ms):
min: 1.81
avg: 1.82
max: 5.85
95th percentile: 1.86
sum: 10000.89

Threads fairness:
events (avg/stddev): 5496.0000/0.00
execution time (avg/stddev): 10.0009/0.00