为了提高软件安装,升级速度,需要我们将树莓派或其他linux系统软件园,改为国内镜像地址(本例使用中科大镜像源)。
1、区分当前系统的Codename
1 lsb_release -c
注:版本有:/ jessie / wheezy / squeeze / stretch / buster
1 stretch
2、修改 /etc/apt/sources.list,将里面内容注释后,在下面添加(修改可用nano,vim等编辑器):
1 deb http://mirrors.ustc.edu.cn/raspbian/raspbian/ stretch main contrib non-free rpi 2 deb-src http://mirrors.ustc.edu.cn/raspbian/raspbian/ stretch main contrib non-free rpi
或者在命令行执行:
1 sudo sed -i 's#://mirrordirector.raspbian.org#s://mirrors.ustc.edu.cn/raspbian#g' /etc/apt/sources.list 2 sudo sed -i 's#://archive.raspberrypi.org/debian#s://mirrors.ustc.edu.cn/archive.raspberrypi.org#g' /etc/apt/sources.list.d/raspi.lis
3、修改 /etc/apt/sources.list.d/raspi.list,将里面内容注释后,在下面添加:
1 deb http://mirrors.ustc.edu.cn/archive.raspberrypi.org/ stretch main ui 2 deb-src http://mirrors.ustc.edu.cn/archive.raspberrypi.org/ stretch main ui
4、检查可更新升级的安装包:
1 sudo apt-get update
5、更新安装包:
1 sudo apt-get -y upgrade