通过网线连接路由器后,主机通过局域网总是无法ping通pi。 通过以下方式查看设置文件,发现有许多重复、无用的配置。清理干净。
sudo vi /etc/dhcpcd.conf之后打开右上角的网络图标,右键,Wireless & Wired Netword Settings 将里面的 “configure” 选择 “interface” “eth0”, IPV4 Address: 192.168.1.102 随便设置一个。 !注意不要设置到路由器的地址池外! 然后重启。通过 ifconfig可以看到ip已经绑定到了102
注意注释掉原有的镜像源,不注释好像还会使用原来的。再修改:
$ sudo nano /etc/apt/sources.list.d/raspi.list deb http://mirrors.tuna.tsinghua.edu.cn/raspberrypi/ stretch main ui deb-src http://mirrors.tuna.tsinghua.edu.cn/raspberrypi/ stretch main ui之后修改完成
Attention: in sources.list, “stretch” is the ‘version’ of current system.
# type $ cat /etc/issue # return 6 -> squeeze 7 -> wheeezy 8 -> jessie 9 -> stretch 10 -> buster在命令行以图形界面打开当前文件夹:使用nautilus指令
$ sudo apt-get install nautilus $ nautilus xxx # 打开目录 $ nautilus $PWD # 打开当前路径当系统时钟不正确时,进行 apt-get update时会提示镜像源需要过xxx小时才能够使用。 这时候需要设置系统时钟。
sudo ntpd -s -d # 同步时钟。需要首先安装 sudo apt-get install ntp sudo date --s="2019-09-26 10:01:20" # 如果上面不正确,需要手动指定