使用 do-release-upgrade 将 Ubuntu 从 16.04 升级到 18.0.4 后,DNS 解析失败

使用 do-release-upgrade 将 Ubuntu 从 16.04 升级到 18.0.4 后,DNS 解析失败

我尝试使用do-release-upgrade命令将 Ubuntu 16.04 升级到 18.04,但升级后 DNS 解析失败。我实际的意图是升级到 20.04,但由于我使用的是 16.04,所以我必须先升级到 18.04。

Ping 谷歌 IP 没问题,但 DNS 本身就不行。我添加了nameserver 8.8.8.8/etc/resolv.conf根据/etc/resolvconf/resolv.conf.d/head提供的解决方案从 16.04 升级到 18.04 后没有互联网但是当我尝试重新启动网络(sudo /etc/init.d/networking restart)时,它失败并出现以下错误:

Restarting networking (via systemctl): networking.serviceJob for networking.service failed because the control process exited with error code.
See "systemctl status networking.service" and "journalctl -xe" for details.
 failed!

systemctl status networking.service
● networking.service - Raise network interfaces
   Loaded: loaded (/lib/systemd/system/networking.service; enabled; vendor preset: enabled)
   Active: failed (Result: exit-code) since Tue 2023-09-05 08:25:00 IST; 22s ago
     Docs: man:interfaces(5)
  Process: 4082 ExecStart=/sbin/ifup -a --read-environment (code=exited, status=1/FAILURE)
  Process: 4070 ExecStartPre=/bin/sh -c [ "$CONFIGURE_INTERFACES" != "no" ] && [ -n "$(ifquery --read-environment --list --exclude=lo)" ] && udevadm settle (code=exited, status=0/SUCCESS)
 Main PID: 4082 (code=exited, status=1/FAILURE)

如何修复?或者有没有办法再次进行干净升级来解决所有这些问题?

相关内容