今天一波睿智操作,想着把python2.7代码改成python3.7,害怕2.7的干扰直接卸掉sudo apt-get remove python2.7,高高兴兴地重启,结果悲剧了,重新烧录了好几次,没有想到python2.7的依赖关系,上网找黑屏的原因也没有找到,结果在找卸载python2.7时找到了,树莓派桌面用的是python2.7,不懂底层的话没事不要把python2.7卸掉。轻易不要使用中文,用putty或者xshell会出现乱码的
卸载python2.7的正确方法
删除依赖关系
sudo rm /usr/bin/python
添加依赖关系
sudo ln -s /usr/bin/python3.7 /usr/bin/python
结果:
镜像源
软件源
sudo nano /etc/apt/sources.list
使用过清华的源最快,注释掉以前的,添加下面这个就行
http://mirrors.tuna.tsinghua.edu.cn/raspbian/raspbian/ buster main contrib non-free rpi
系统源
sudo nano /etc/apt/sources.list.d/raspi.list
注释掉以前的也是清华的源
deb http://mirrors.tuna.tsinghua.edu.cn/raspbian/raspbian/ buster main
固定ip地址
sudo nano /etc/dhcpcd.conf
找到并添加(我用的是无线网,有线网直接在原来的上面改)
改static ip_address = 你的ip地址/24
和static routers=
ip地址用ifconfig
进行查看
设置屏幕长亮
sudo nano /etc/lightdm/lightdm.conf
修改成
-s:设置屏幕保护不启动,-dpms:关闭电源节能管理