换国内镜像源
解决升级慢或Cannot initiate the connection to mirrors.opencas.cn问题:
1
sudo nano /etc/apt/sources.list
修改sources.list,注释第一行,在最后添加国内镜像站:
deb http://mirrors.aliyun.com/raspbian/raspbian/ stretch main non-free contrib
deb-src http://mirrors.aliyun.com/raspbian/raspbian/ stretch main non-free contrib
2
sudo nano /etc/apt/sources.list.d/raspi.list
注释第一行,在最后添加:
deb https://mirrors.tuna.tsinghua.edu.cn/raspberrypi/ stretch main ui
固件升级(谨慎操作,可能会踩到奇怪的编译坑):
sudo rpi-update && sudo reboot -h now
软件包升级:
time sudo apt-get update && time sudo apt-get upgrade && time sudo apt-get dist-upgrade
软件包清理,顺便装个vim:
sudo apt-get install -y vim
sudo apt-get clean
使用ssh连接
在树莓派上连接一个显示器十分麻烦,不如用ssh直接在电脑上操控。(前提是树莓派和电脑在同意网络里)
首先打开shell
输入ifconfig 查看树莓派的内网ip,并记住他
输入
sudo raspi-config
(树莓派设置)回车
选择第三项回车
选择·第二项ssh开启服务