解决升级慢或Cannot initiate the connection to mirrors.opencas.cn问题:
1
sudo vi /etc/apt/sources.list
修改sources.list,注释第一行,在最后添加国内镜像站:
1 2
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
# 中科大 deb http://mirrors.ustc.edu.cn/raspbian/raspbian/ stretch main contrib non-free rpi # 清华 deb https://mirrors.tuna.tsinghua.edu.cn/raspbian/raspbian/ stretch main contrib non-free rpi # 大连东软 deb http://mirrors.neusoft.edu.cn/raspbian/raspbian/ stretch main contrib non-free rpi # 重庆大学 deb http://mirrors.cqu.edu.cn/raspbian/raspbian/ stretch main contrib non-free rpi # 浙江大学 deb http://mirrors.zju.edu.cn/raspbian/raspbian/ stretch main contrib non-free rpi # 阿里云 deb http://mirrors.aliyun.com/raspbian/raspbian/ stretch main contrib non-free rpi # 搜狐 deb http://mirrors.sohu.com/raspbian/raspbian/ stretch main contrib non-free rpi # 元智大学(中国台湾) deb http://ftp.cse.yzu.edu.tw/Linux/raspbian/raspbian/ stretch main contrib non-free rpi # 新加坡国立大学 deb http://mirror.nus.edu.sg/raspbian/raspbian/ stretch main contrib non-free rpi # 北陆先端科学技术大学院大学(日本知名镜像站,日常出口带宽2g) deb http://ftp.jaist.ac.jp/raspbian/ stretch main contrib non-free rpi # 牛津大学 deb http://mirror.ox.ac.uk/sites/archive.raspbian.org/archive/raspbian/ stretch main contrib non-free rpi # 美国Berkely大学 deb http://mirrors.ocf.berkeley.edu/raspbian/raspbian/ stretch main contrib non-free rpi # 美国俄克拉荷马大学 deb http://reflection.oss.ou.edu/raspbian/raspbian/ stretch main contrib non-free rpi # 南非知名软件源 deb http://mirror.liquidtelecom.com/raspbian/raspbian/ stretch main contrib non-free rpi # 默认源(带重定向by mirrorbrain) deb http://mirrordirector.raspbian.org/raspbian/ stretch main contrib non-free rpi # 官方源 deb https://archive.raspbian.org/raspbian/ stretch main contrib non-free rpi
同样的,修改raspi.list,树莓派的软件包源仅有清华和中科大镜像:
1
sudo vi /etc/apt/sources.list.d/raspi.list
注释第一行,在最后添加:
1
deb https://mirrors.tuna.tsinghua.edu.cn/raspberrypi/ stretch main ui
或者直接在树莓派上执行:
1 2
sudo sed -i 's#://raspbian.raspberrypi.org#s://mirrors.tuna.tsinghua.edu.cn/raspbian#g' /etc/apt/sources.list sudo sed -i 's#://archive.raspberrypi.org/debian#s://mirrors.tuna.tsinghua.edu.cn/raspberrypi#g' /etc/apt/sources.list.d/raspi.list
sudo ufw allow proto tcp to 0.0.0.0/0 port 22 comment "sshd listen port" sudo ufw allow proto tcp to 0.0.0.0/0 port 1080 comment "Shadowsocks server listen port" sudo ufw allow proto tcp to 0.0.0.0/0 port 5900 comment "vnc server listen port" # 有时候需要用python -m http.server 8000传文件,开个口比较方便 sudo ufw allow proto tcp to 0.0.0.0/0 port 8000 comment "for python -m http.server 8000" sudo ufw default deny sudo ufw enable
mkdir misc && cd misc git clone https://github.com/rofl0r/proxychains-ng
安装:
1 2 3 4 5 6 7 8
cd proxychains-ng/ ./configure --prefix=/usr --sysconfdir=/etc # 若是macOS下安装可能会遇到/usr/lib因SIP保护禁止写入的问题,需要更改配置为: #./configure --prefix=/usr/local --sysconfdir=/etc # ref: https://apple.stackexchange.com/questions/208764/cant-write-to-usr-lib make sudo make install sudo make install-config
# 安装proxychains mkdir misc && cd misc git clone https://github.com/rofl0r/proxychains-ng cd proxychains-ng/ ./configure --prefix=/usr --sysconfdir=/etc make sudo make install sudo make install-config cd ~