How to restore a working network configuration with netplan on Ubuntu 20.04

Solution 1:

Edit your /etc/netplan/01-network-manager-all.yaml to this. Keep the spacing, indentation, and no tabs, exactly as I show it.


For server or systemd-networkd:

network:
  version: 2
  renderer: networkd
  ethernets:
    eth0:
      dhcp4: true

For desktop and NetworkManager:

network:
  version: 2
  renderer: NetworkManager

sudo netplan --debug generate

sudo netplan apply

reboot

Update #1:

I've loaded Ubuntu Live and I saw the eth0 interface and it worked.

Update #2:

RTL8111/8168/8411 PCI Express Gigabit Ethernet Controller does not work with kernel 5.4.0-42-generic ; it says that the device is unclaimed. Instead, with the kernel 5.4.0-41-generic it worked perfectly. so this is a bug of that kernel version.

Update #3:

Installed the r8168-dkms driver, and it works with kernel 5.4.0-42-generic.

Note that the -41 kernel, and the broken -42 kernel, came from enabling the Proposed repository. I'd recommend disabling that repo.