前言

记录一些树莓派4B的记录,使用的是树莓派爱好者基地64位系统2.0正式版(Debian)的系统。

工具记录

  1. Raspberry Pi OS
  2. SDFormatter
  3. win32diskimager
  4. www.advanced-ip-scanner
  5. Debian-Pi-Aarch64
  6. balenaEtcher

基础设置

开启SSH

1
$ new-item ssh -type file

配置wifi连接文件

1
$ vim wpa_supplicant.conf
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
country=CN
ctrl_interface=DIR=/var/run/wpa_supplicant GROUP=netdev
update_config=1

network={
ssid="909"
psk="1393877285"
key_mgmt=WPA-PSK
priority=1
}

network={
ssid="WiFi-B"
psk="12345678"
key_mgmt=WPA-PSK
priority=2
scan_ssid=1
}

#ssid:网络的ssid
#psk:密码
#priority:连接优先级,数字越大优先级越高(不可以是负数)
#scan_ssid:连接隐藏WiFi时需要指定该值为1

编译安装python3.9.9

更新系统

1
2
$ sudo apt update
$ sudo apt upgrade

安装环境依赖

1
$ sudo apt install build-essential libsqlite3-dev sqlite3 bzip2 libbz2-dev libffi-dev -y

注意如果没安装libffi-dev的话可能会出现ModuleNotFoundError: No module named '_ctypes'错误

下载&解压

1
2
3
$ wget https://npm.taobao.org/mirrors/python/3.9.9/Python-3.9.9.tgz
$ tar zxvf Python-3.9.9.tgz
$ cd Python-3.9.9

编译安装

1
2
3
4
5
6
# --enable-optimizations(优化参数 自选)
$ sudo ./configure --enable-optimizations
$ sudo make
$ sudo make install
# 等待完成检查
$ ls -al /usr/local/bin/python*

添加PIP alias

1
alias pq3.9='sudo pip3.9 install -i http://mirrors.aliyun.com/pypi/simple/ --trusted-host mirrors.aliyun.com'

替换默认Python

1
2
3
$ sudo rm /usr/bin/python
$ sudo ln -s /usr/bin/python3.9 /usr/bin/python
$ python

安装oh-my-zsh

1
2
3
4
5
$ sh -c "$(curl -fsSL https://ghproxy.com/https://raw.github.com/ohmyzsh/ohmyzsh/master/tools/install.sh)"
$ git clone https://ghproxy.com/https://github.com/zsh-users/zsh-syntax-highlighting.git ${ZSH_CUSTOM:-~/.oh-my-zsh/custom}/plugins/zsh-syntax-highlighting
$ git clone https://ghproxy.com/https://github.com/zsh-users/zsh-autosuggestions ${ZSH_CUSTOM:-~/.oh-my-zsh/custom}/plugins/zsh-autosuggestions
$ git clone https://ghproxy.com/https://github.com/zsh-users/zsh-completions ${ZSH_CUSTOM:=~/.oh-my-zsh/custom}/plugins/zsh-completions
$ git clone https://ghproxy.com/https://github.com/dracula/zsh.git ${ZSH_CUSTOM:=~/.oh-my-zsh/themes/

结束

End