如何通过 VPN 连接运行 apt update?

如何通过 VPN 连接运行 apt update?

使用默认的sources.list

deb http://deb.debian.org/debian bullseye main
deb-src http://deb.debian.org/debian bullseye main

deb http://deb.debian.org/debian-security/ bullseye-security main
deb-src http://deb.debian.org/debian-security/ bullseye-security main

deb http://deb.debian.org/debian bullseye-updates main
deb-src http://deb.debian.org/debian bullseye-updates main

apt update未连接到 VPN 时工作正常,但连接到 VPN 后,和组件apt update超时:bullseyebullseye-security

$ apt update
Get:1 http://deb.debian.org/debian bullseye InRelease [113 kB]
Err:1 http://deb.debian.org/debian bullseye InRelease
  Connection timed out [IP: 151.101.54.132 80]
Get:2 http://deb.debian.org/debian-security bullseye-security InRelease [44.1 kB]
Err:2 http://deb.debian.org/debian-security bullseye-security InRelease
  Connection timed out [IP: 151.101.54.132 80]
Get:3 http://deb.debian.org/debian bullseye-updates InRelease [36.8 kB]
Fetched 36.8 kB in 1min 1s (601 B/s)
Reading package lists... Done
Building dependency tree... Done
Reading state information... Done
All packages are up to date.
W: Failed to fetch http://deb.debian.org/debian/dists/bullseye/InRelease  Connection timed out [IP: 151.101.54.132 80]
W: Failed to fetch http://deb.debian.org/debian-security/dists/bullseye-security/InRelease  Connection timed out [IP: 151.101.54.132 80]
W: Some index files failed to download. They have been ignored, or old ones used instead.

如何apt update通过 VPN 连接运行?

答案1

看起来deb.debian.orgVPN 屏蔽比某些镜像更严格。更新您的sources.list以使用本地镜像对于该bullseye组件,以及securitysecurity组件的子域,可以允许apt update继续。例如,当我在美国连接到 VPN 时,以下sources.list 适用于我:

deb http://ftp.us.debian.org/debian/ bullseye main
deb-src http://ftp.us.debian.org/debian/ bullseye main

deb http://security.debian.org/debian-security/ bullseye-security main
deb-src http://security.debian.org/debian-security/ bullseye-security main

deb http://ftp.us.debian.org/debian/ bullseye-updates main
deb-src http://ftp.us.debian.org/debian/ bullseye-updates main

相关内容