树莓派 更换源

  • 机型:树莓派4B(4G版本)
  • 系统:Raspberry Pi OS(64 bit)
1. 备份源文件
ssh连接到树莓派,备份源文件 sources.list 和 raspi.list
$ sudo cp /etc/apt/sources.list /etc/apt/sources.list.bak
$ sudo cp /etc/apt/sources.list.d/raspi.list /etc/apt/sources.list.d/raspi.list.bak
2 修改 sources.list 文件,用以下内容替换:
$ sudo nano /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 nano /etc/apt/sources.list.d/raspi.list
deb http://mirrors.tuna.tsinghua.edu.cn/raspberrypi/ buster main ui
3. 同步更新源、软件包
执行以下命令:
$ sudo apt-get update
$ sudo apt-get upgrade

 

 

发表评论