2

I just migrated from Ubuntu 18.04 to Ubuntu 20.04. After days of struggle from drivers incompatibility, I thought everything works well until I realized my computer cannot connect to the LAN internet.

Most internet-related problems that I read refers to netplan:

From what I understood, netplan is being used to manage everything related to networking on Ubuntu 20.04. So I followed the tutorials and updated my /etc/netplan/01-network-manager-all.yaml to:

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

When I tried to run either sudo netplan generate or sudo netplan apply. I got an error message:

sudo: netplan: command not found

I thought probably it's because netplan is not installed (weirdly). So I tried to run this command:

sudo apt install netplan

But I encountered this error:

Reading package lists... Done
Building dependency tree       
Reading state information... Done
Package netplan is not available, but is referred to by another package.
This may mean that the package is missing, has been obsoleted, or
is only available from another source

E: Package 'netplan' has no installation candidate

Any idea what should be done? Feel free to also suggest on how to improve the question. Thanks in advance!

3 Answers3

5

It looks like your 18.04 upgrade to 20.04 didn't complete properly. This will probably take a clean install of 20.04 to fix, but we can try this...

In terminal...

sudo apt-get update

sudo apt-get upgrade

sudo apt-get install netplan.io

Then edit /etc/netplan/01-network-manager-all.yaml so it looks like this...

network:
  version: 2
  renderer: NetworkManager

sudo netplan generate

sudo netplan apply

reboot

heynnema
  • 70,711
  • But note that netplan was already part of the base system in 18.04 so the upgrade problem is possibly much older. – slangasek Oct 10 '20 at 21:58
  • And there should be no change in behavior of NetworkManager between 18.04 and 20.04 and thus no need to add netplan yaml to make NM work. This is more likely to be a low level driver issue. – slangasek Oct 10 '20 at 22:00
  • @slangasek Correct... netplan was already a part of the base system in 18.04... however, OP is getting "sudo: netplan: command not found" errors, and OP was trying to configure a Ubuntu Desktop installation like it was a Server installation, and that was failing too. I think it's just a bad 20.04 upgrade. – heynnema Oct 10 '20 at 22:10
  • It worked for me also on Ubuntu 21.04 – Jose Celano Dec 02 '21 at 09:25
0

If the netplan command is not found, try:

sudo apt install netplan.io

instead of

sudo apt install netplan
0

My Ubuntu 20.04 was using NetworkManager. I had to use:

sudo netplan apply  

And the below commands to have wired connection working.

sudo nmcli networking off
sudo nmcli networking on
karel
  • 114,770