我的sources.list
:
deb http://http.debian.net/debian wheezy main contrib non-free
deb-src http://http.debian.net/debian wheezy main contrib non-free
deb http://http.debian.net/debian wheezy-updates main contrib non-free
deb-src http://http.debian.net/debian wheezy-updates main contrib non-free
deb http://security.debian.org/ wheezy/updates main contrib non-free
deb-src http://security.debian.org/ wheezy/updates main contrib non-free
每当我尝试执行以下命令时,
apt update OR apt-get update
它卡在:
0% [Connecting to http.debian.net (2001:67c:2564:a119::148:14)]
有人可以帮助我吗?
答案1
http://http.debian.net/debian
似乎不包含 Debian 软件包存储库,因此您的sources.list
设置需要更新。
另外,你sources.list
提到的wheezy
。这是 Debian 7 的发行版名称,而不是 Debian 9。cat /etc/debian_version
您的输出是什么?
如果它报告以 7 开头的数字,则您正在运行 Debian 7(“Wheezy”),而不是 Debian 9。在这种情况下,您应该仔细考虑升级:Debian 7 的长期支持将于 2018 年 5 月结束31号,也就是两个月后。
sources.list
您可以从此处找到 Debian 7 LTS 文件的正确设置:
https://wiki.debian.org/LTS/Using
deb http://deb.debian.org/debian/ wheezy main contrib non-free
deb-src http://deb.debian.org/debian/ wheezy main contrib non-free
deb http://security.debian.org/ wheezy/updates main contrib non-free
deb-src http://security.debian.org/ wheezy/updates main contrib non-free
deb http://deb.debian.org/debian/ wheezy-updates main contrib non-free
deb-src http://deb.debian.org/debian/ wheezy-updates main contrib non-free
如果cat /etc/debian_version
报告以 9 开头的数字,您应该使用sources.list
Kiwy 的答案中显示的设置。
答案2
您提到 Debian 9,您的文件/etc/apt/sources.list
应如下所示:
deb http://deb.debian.org/debian stretch main contrib non-free
deb-src http://deb.debian.org/debian stretch main contrib non-free
deb http://deb.debian.org/debian stretch-updates main contrib non-free
deb-src http://deb.debian.org/debian stretch-updates main contrib non-free
deb http://security.debian.org/debian-security/ stretch/updates main contrib non-free
deb-src http://security.debian.org/debian-security/ stretch/updates main contrib non-free
答案3
请在 sysctl 添加 srin 中禁用 ipv6/etc/sysctl.conf
net.ipv6.conf.all.disable_ipv6 = 1
net.ipv6.conf.default.disable_ipv6 = 1
net.ipv6.conf.lo.disable_ipv6 = 1
sysctl -p
或重新启动