sudo vim /etc/apt/sources.list # 把原来的内容注释掉(最前面加 # 号),在文件最顶部添加下面的内容: deb https://mirrors.tuna.tsinghua.edu.cn/debian buster main contrib non-free deb https://mirrors.tuna.tsinghua.edu.cn/debian-security/ buster/updates main contrib non-free deb https://mirrors.tuna.tsinghua.edu.cn/debian buster-updates main contrib non-free # 修改 raspi.list 文件,用以下内容替换(树莓派基金会单独提供的源,与32位Pi OS的一致): sudo vim /etc/apt/sources.list.d/raspi.list deb http://mirrors.tuna.tsinghua.edu.cn/raspberrypi/ buster main ui # 同步更新源、软件包 sudo apt-get update sudo apt-get upgrade # 安装必要的库和包 sudo apt-get install build-essential cmake make gcc
如遇到以下报错,可以通过导入对应仓库的公钥来解决
Get:1 http://mirrors.tuna.tsinghua.edu.cn/raspbian/raspbian buster InRelease [15.0 kB] Hit:2 http://mirrors.tuna.tsinghua.edu.cn/raspberrypi buster InRelease Err:1 http://mirrors.tuna.tsinghua.edu.cn/raspbian/raspbian buster InRelease The following signatures couldn't be verified because the public key is not available: NO_PUBKEY 9165938D90FDDD2E Reading package lists... Done W: GPG error: http://mirrors.tuna.tsinghua.edu.cn/raspbian/raspbian buster InRelease: The following signatures couldn't be verified because the public key is not available: NO_PUBKEY 9165938D90FDDD2E
Installing Python-3.8.9... WARNING: The Python bz2 extension was not compiled. Missing the bzip2 lib? WARNING: The Python readline extension was not compiled. Missing the GNU readline lib? ERROR: The Python ssl extension was not compiled. Missing the OpenSSL lib?
Please consult to the Wiki page to fix the problem. https://github.com/pyenv/pyenv/wiki/Common-build-problems
BUILD FAILED (Debian 10 using python-build 2.0.7-19-g9ecfdd10)