Linux change archive mirror All In One
Linux / Debian / Ubuntu / Raspberry Pi OS
$ sudo apt-get update
Hit:1 http://deb.debian.org/debian bullseye InRelease
Get:2 http://security.debian.org/debian-security bullseye-security InRelease [48.4 kB]
Get:3 http://deb.debian.org/debian bullseye-updates InRelease [44.1 kB]
Get:4 http://archive.raspberrypi.org/debian bullseye InRelease [23.6 kB]
Get:5 http://security.debian.org/debian-security bullseye-security/main armhf Packages [232 kB]
Get:6 http://deb.debian.org/debian bullseye-updates/main armhf Packages [12.0 kB]
Get:7 http://deb.debian.org/debian bullseye-updates/main arm64 Packages [12.0 kB]
Get:8 http://archive.raspberrypi.org/debian bullseye/main armhf Packages [316 kB]
Get:9 http://archive.raspberrypi.org/debian bullseye/main arm64 Packages [308 kB]
Get:10 http://security.debian.org/debian-security bullseye-security/main arm64 Packages [232 kB]
Get:11 http://security.debian.org/debian-security bullseye-security/main Translation-en [155 kB]
Fetched 1383 kB in 19s (72.9 kB/s)
Reading package lists... Done
install
# 安装 vim
$ sudo apt-get install vim
# 安装中文输入法 chinese input
$ sudo apt-get install scim-pinyin
# 重启系统
$ sudo reboot
# 或者
$ sudo shutdown -r now
test
# static ip
$ vim dhcpcd.conf
# disk free
$ df
$ df -h
$ df -Th
https://www.raspberrypi.com/documentation/computers/configuration.html#configuring-networking-2
https://www.raspberrypi.com/documentation/computers/configuration.html#static-ip-addresses
demos
切换 Linux 镜像源 / 切换 Raspberry Pi 镜像源
$ sudo apt-get update
获取:1 http://archive.raspberrypi.org/debian buster InRelease [32.6 kB]
获取:2 http://raspbian.raspberrypi.org/raspbian buster InRelease [15.0 kB]
正在读取软件包列表... 完成
E: 仓库'http://archive.raspberrypi.org/debian buster InRelease'将其'Suite'值从'testing'修改到了'oldstable'
N: 为了让这个仓库能够应用,这必须在更新之前显式接受。更多细节请参阅 apt-secure(8) 手册。
E: 仓库'http://raspbian.raspberrypi.org/raspbian buster InRelease'将其'Suite'值从'stable'修改到了'oldstable'
N: 为了让这个仓库能够应用,这必须在更新之前显式接受。更多细节请参阅 apt-secure(8) 手册。
$ sudo vim /etc/apt/sources.list
$ sudo cat /etc/apt/sources.list
# new ✅
deb http://mirrors.ustc.edu.cn/raspbian/raspbian/ buster main contrib non-free rpi
# tsinghua 不好使 ❌
# deb http://mirror.tuna.tsinghua.edu.cn/raspberrypi/ stretch main ui
# deb-src http://mirror.tuna.tsinghua.edu.cn/raspberrypi/ stretch main ui
# old ❌
# deb http://raspbian.raspberrypi.org/raspbian/ buster main contrib non-free rpi
# Uncomment line below then 'apt-get update' to enable 'apt-get source'
#deb-src http://raspbian.raspberrypi.org/raspbian/ buster main contrib non-free rpi
$ sudo vim /etc/apt/sources.list.d/raspi.list
$ sudo cat /etc/apt/sources.list.d/raspi.list
# new ✅
deb http://mirrors.ustc.edu.cn/archive.raspberrypi.org/debian/ buster main
# old ❌
#deb http://archive.raspberrypi.org/debian/ buster main
# Uncomment line below then 'apt-get update' to enable 'apt-get source'
#deb-src http://archive.raspberrypi.org/debian/ buster main
USTC Open Source Software Mirror
中国科学技术大学
获取 IP 通过 SSH 访问 Raspberry Pi
# 获取 IP
$ ping raspberrypi
# SSH, host ✅
$ ssh [email protected]
# SSH, ip ❓
$ ssh [email protected]
➜ ~ ping raspberrypi
ping: cannot resolve raspberrypi: Unknown host
➜ ~ ping raspberrypi.local
PING raspberrypi.local (192.168.18.135): 56 data bytes
64 bytes from 192.168.18.135: icmp_seq=0 ttl=64 time=207.268 ms
64 bytes from 192.168.18.135: icmp_seq=1 ttl=64 time=13.262 ms
^C
--- raspberrypi.local ping statistics ---
2 packets transmitted, 2 packets received, 0.0% packet loss
round-trip min/avg/max/stddev = 13.262/110.265/207.268/97.003 ms
➜ ~ ssh [email protected]
@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@
@ WARNING: REMOTE HOST IDENTIFICATION HAS CHANGED! @
@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@
IT IS POSSIBLE THAT SOMEONE IS DOING SOMETHING NASTY!
Someone could be eavesdropping on you right now (man-in-the-middle attack)!
It is also possible that a host key has just been changed.
The fingerprint for the ED25519 key sent by the remote host is
SHA256:RDtJTesQX/nQU+4pRcsqtQFV5kXbdM05U5gppFpG2dU.
Please contact your system administrator.
Add correct host key in /Users/xgqfrms-mm/.ssh/known_hosts to get rid of this message.
Offending ECDSA key in /Users/xgqfrms-mm/.ssh/known_hosts:4
Host key for 192.168.18.135 has changed and you have requested strict checking.
Host key verification failed.
➜ ~ ssh [email protected]
[email protected]'s password:
Permission denied, please try again.
[email protected]'s password:
Permission denied, please try again.
[email protected]'s password:
Linux raspberrypi 5.15.84-v8+ #1613 SMP PREEMPT Thu Jan 5 12:03:08 GMT 2023 aarch64
The programs included with the Debian GNU/Linux system are free software;
the exact distribution terms for each program are described in the
individual files in /usr/share/doc/*/copyright.
Debian GNU/Linux comes with ABSOLUTELY NO WARRANTY, to the extent
permitted by applicable law.
Last login: Mon Apr 10 01:38:46 2023
SSH is enabled and the default password for the 'pi' user has not been changed.
This is a security risk - please login as the 'pi' user and type 'passwd' to set a new password.
pi@raspberrypi:~ $