尽管 http/https 协议在机器上运行良好,但我无法连接到任何 ubuntu 服务器(尝试了几个)。
当我尝试使用软件更新程序进行更新时出现同样的错误。
我检查了这是否是名称服务器问题,但显然不是。当我 ping google DNS(4.4.4.4、4.4.4.8)时,我没有得到任何响应
我将非常感激听到任何建议.. :_(
> swashbuckler@swashbuckler-All-Series:/etc$ sudo apt-get update Err:1
> http://archive.ubuntu.com/ubuntu bionic InRelease
> Could not connect to 192.168.1.253:80 (192.168.1.253). - connect (113:
> No route to host) Err:2 http://cran.rstudio.com/bin/linux/ubuntu
> bionic-cran35/ InRelease Unable to connect to 192.168.1.253:http:
> Err:3 http://archive.ubuntu.com/ubuntu bionic-updates InRelease
> Unable to connect to 192.168.1.253:http: Err:4
> http://ppa.launchpad.net/marutter/rrutter/ubuntu bionic InRelease
> Unable to connect to 192.168.1.253:http: Err:5
> http://archive.ubuntu.com/ubuntu bionic-backports InRelease Unable
> to connect to 192.168.1.253:http: Err:6
> http://archive.ubuntu.com/ubuntu bionic-security InRelease Unable to
> connect to 192.168.1.253:http: Reading package lists... Done W: Failed
> to fetch http://archive.ubuntu.com/ubuntu/dists/bionic/InRelease
> Could not connect to 192.168.1.253:80 (192.168.1.253). - connect (113:
> No route to host) W: Failed to fetch
> http://archive.ubuntu.com/ubuntu/dists/bionic-updates/InRelease
> Unable to connect to 192.168.1.253:http: W: Failed to fetch
> http://archive.ubuntu.com/ubuntu/dists/bionic-backports/InRelease
> Unable to connect to 192.168.1.253:http: W: Failed to fetch
> http://archive.ubuntu.com/ubuntu/dists/bionic-security/InRelease
> Unable to connect to 192.168.1.253:http: W: Failed to fetch
> http://cran.rstudio.com/bin/linux/ubuntu/bionic-cran35/InRelease
> Unable to connect to 192.168.1.253:http: W: Failed to fetch
> http://ppa.launchpad.net/marutter/rrutter/ubuntu/dists/bionic/InRelease
> Unable to connect to 192.168.1.253:http: W: Some index files failed to
> download. They have been ignored, or old ones used instead.
答案1
我遇到了类似的问题,并通过以下方式解决了它:
我删除了文件 /etc/netplan/50-cloud-init^_copy.yaml。它就像变魔术一样出现在 netplan 文件夹中。它也可能是“麻烦制造者”。这始终列在提到的错误消息中。
然后我测试
sudo netplan --debug apply
并获得了正确的网络设置的系统调试配置。
以下是我的:
network: bonds: {} bridges: {} ethernets: enp3s0f0: addresses: - 192.168.178.122/24 dhcp4: false dhcp6: true gateway4: 192.168.178.1 nameservers: addresses: - 192.168.178.33 - 192.168.178.1 optional: true enp3s0f1: addresses: - 192.168.178.123/24 dhcp4: false dhcp6: true gateway4: 192.168.178.1 nameservers: addresses: - 192.168.178.33 - 192.168.178.1 optional: true enp4s0f0: addresses: - 192.168.178.124/24 dhcp4: false dhcp6: true gateway4: 192.168.178.33 nameservers: addresses: - 192.168.178.33 - 192.168.178.1 optional: true enp4s0f1: addresses: - 192.168.178.125/24 dhcp4: false dhcp6: true gateway4: 192.168.178.33 nameservers: addresses: - 192.168.178.33 - 192.168.178.1 optional: true vlans: {} wifis: {}
这个配置我放入了原来的50-cloud-init-yaml中,并保存了下来。
sudo netplan apply
我重新启动了 netplan。它向sudo ifconfig
我显示了正确的配置,并且我获得了 apt 的互联网连接等等。