Debian 9-无法更新 apt

Debian 9-无法更新 apt

我最近安装了 Debian 9,但几天前我就无法更新 apt。我尝试 ping 局域网中的其他 PC,但无法连接它们,但可以 ping 路由器。从局域网中的其他 PC,我可以连接 Debian PC。

解析配置文件

nameserver 8.8.8.8
nameserver 8.8.4.4

/etc/网络/接口

# The loopback network interface
auto lo
iface lo inet loopback

# The primary network interface
 allow-hotplug enp3s0
 iface enp3s0 inet static
        address 192.168.1.15
        netmask 255.255.255.0
        gateway 192.168.1.1

/etc/apt/sources.list

# deb cdrom:[Debian GNU/Linux 9.8.0 _Stretch_ - Official amd64 NETINST 20190216$

#deb cdrom:[Debian GNU/Linux 9.8.0 _Stretch_ - Official amd64 NETINST 20190216-$

deb http://ftp.it.debian.org/debian/ stretch main
deb-src http://ftp.it.debian.org/debian/ stretch main

deb http://security.debian.org/debian-security stretch/updates main
deb-src http://security.debian.org/debian-security stretch/updates main

# stretch-updates, previously known as 'volatile'
deb http://ftp.it.debian.org/debian/ stretch-updates main
deb-src http://ftp.it.debian.org/debian/ stretch-updates main

当我启动 apt-get update 命令时,结果是:

0% [Connessione a ftp.it.debian.org (85.94.199.210)] [Connessione a prod.debian

并且没有其他任何功能。我该怎么办?

答案1

我将首先使用 curl 之类的工具和您在 sources.list 中指定的 debian 镜像来测试整个链:

$ curl -LIv http://ftp.it.debian.org
* Rebuilt URL to: http://ftp.it.debian.org/
*   Trying 85.94.199.210...
* TCP_NODELAY set
* Connected to ftp.it.debian.org (85.94.199.210) port 80 (#0)
> HEAD / HTTP/1.1
> Host: ftp.it.debian.org
> User-Agent: curl/7.61.1
> Accept: */*
> 
< HTTP/1.1 200 OK
HTTP/1.1 200 OK
< Content-Type: text/html
Content-Type: text/html
< Accept-Ranges: bytes
Accept-Ranges: bytes
< ETag: "3184558369"
ETag: "3184558369"
< Last-Modified: Wed, 23 May 2018 02:48:55 GMT
Last-Modified: Wed, 23 May 2018 02:48:55 GMT
< Content-Length: 2142
Content-Length: 2142
< Date: Tue, 16 Apr 2019 18:06:49 GMT
Date: Tue, 16 Apr 2019 18:06:49 GMT
< Server: lighttpd/1.4.45
Server: lighttpd/1.4.45

< 
* Connection #0 to host ftp.it.debian.org left intact

这是一次成功的测试。如果您看到一些不同的东西,则可能是 DNS 问题,或者您的终端存在其他连接问题(例如防火墙或配置错误的代理服务器)。

相关内容