杭州建设网站的公司哪家好,家用电脑做网站能备案,wordpress适合国人的编辑器,个人备案网站内容一、教程简介
在中国大陆地区#xff0c;使用清华镜像源可以显著缩短资源下载时间。
本教程介绍如何将清华镜像源设置为树莓派的apt、pip、conda下载的首选项#xff08;默认项#xff09;。其中#xff0c;apt和pip为树莓派系统自带#xff0c;conda则需要安装miniforg…一、教程简介
在中国大陆地区使用清华镜像源可以显著缩短资源下载时间。
本教程介绍如何将清华镜像源设置为树莓派的apt、pip、conda下载的首选项默认项。其中apt和pip为树莓派系统自带conda则需要安装miniforge后方可使用。因此本教程将同步介绍如何在树莓派上安装和使用conda。
本教程使用Windows 11计算机通过SSH远程控制4B树莓派 Lite OS, 64Bit所有操作均在Mobaxterm软件上执行。 如果不知道如何安装无桌面版本的树莓派系统请先使用以下教程。
http://t.csdnimg.cn/q3tiahttp://t.csdnimg.cn/q3tia 二、设置apt首选清华镜像源
1、编辑apt下载源配置文件
# 编辑sources.list
sudo nano /etc/apt/sources.list
# 设置清华镜像源
deb https://mirrors.tuna.tsinghua.edu.cn/raspberrypi/ bookworm main
注意应该保留自动的apt下载源以下是修改后的sources.list文件。
deb https://mirrors.tuna.tsinghua.edu.cn/raspberrypi/ bookworm main
deb http://deb.debian.org/debian bookworm main contrib non-free non-free-firmware
deb http://deb.debian.org/debian-security/ bookworm-security main contrib non-free non-free-firmware
deb http://deb.debian.org/debian bookworm-updates main contrib non-free non-free-firmware
# Uncomment deb-src lines below then apt-get update to enable apt-get source
#deb-src http://deb.debian.org/debian bookworm main contrib non-free non-free-firmware
#deb-src http://deb.debian.org/debian-security/ bookworm-security main contrib non-free non-free-firmware
#deb-src http://deb.debian.org/debian bookworm-updates main contrib non-free non-free-firmware
编辑完成后使用CTRLX关闭文件并键入Y最后按Enter。
2、更新apt下载源配置
使用以下指令更新apt下载源如果看到新增加的清华镜像源则说明sources.list已成功添加。
sudo apt update 3、更新软件
sudo apt upgrade 三、设置pip首选清华镜像源
1、打开pip下载源配置文件
mkdir -p $HOME/.pip nano $HOME/.pip/pip.conf
2、编辑pip下载源配置文件
[global]
index-url https://pypi.tuna.tsinghua.edu.cn/simple
extra-index-url https://pypi.org/simple
同样地编辑完成后使用CTRLX关闭文件并键入Y最后按Enter。 四、安装miniforge
1、下载安装脚本
# 如果第一个无法下载则使用第二个# GitHub链接
wget https://github.com/conda-forge/miniforge/releases/latest/download/Miniforge3-Linux-aarch64.sh
# 加速链接
wget https://gh.api.99988866.xyz/https://github.com/conda-forge/miniforge/releases/download/24.3.0-0/Miniforge3-Linux-aarch64.sh
2、设置可执行权限
chmod x Miniforge3-Linux-aarch64.sh
3、运行安装脚本
./Miniforge3-Linux-aarch64.sh -b
4、添加到PATH环境
echo export PATH$HOME/miniforge3/bin:$PATH ~/.bashrc
source ~/.bashrc
5、初始化conda
输入以下指令。当显示以下界面时说明conda指令可用。
conda 输入以下指令初始化conda。
conda init
重启树莓派输入以下指令。
sudo reboot
然后键入R。 重启后用户名前方出现了(base)字样表示conda已经完整初始化。 五、设置conda首选清华镜像源
1、添加清华镜像源并设默认
conda config --add channels https://mirrors.tuna.tsinghua.edu.cn/anaconda/pkgs/main
conda config --add channels https://mirrors.tuna.tsinghua.edu.cn/anaconda/cloud/conda-forge
2、设置通道优先级为严格模式
conda config --set channel_priority strict
3、设置镜像源URLs显示
conda config --set show_channel_urls yes
4、检查通道
conda config --show channels
如果显示以下界面说明conda已经首选清华镜像源。 END