Raspberry Pi 更新为清华大学软件源

cd ~
(
cat << EOF
deb http://mirrors.tuna.tsinghua.edu.cn/raspbian/raspbian/ stretch main contrib non-free rpi
deb-src http://mirrors.tuna.tsinghua.edu.cn/raspbian/raspbian/ stretch main contrib non-free rpi
EOF
) >sources.list

(
cat << EOF
deb http://mirror.tuna.tsinghua.edu.cn/raspberrypi/ stretch main ui
deb-src http://mirror.tuna.tsinghua.edu.cn/raspberrypi/ stretch main ui
EOF
) >raspi.list

cd /etc/apt
sudo mv sources.list sources.list.back
sudo mv ~/sources.list ./
cd sources.list.d
sudo mv raspi.list ../raspi.list.back
sudo mv ~/raspi.list ./

感谢水清源先生提供上面的代码。

分享