Skip to content

Instantly share code, notes, and snippets.

@SteaceP
Created December 17, 2020 06:48
Show Gist options
  • Save SteaceP/4c95814899ae8d647aa2cb37f75dd330 to your computer and use it in GitHub Desktop.
Save SteaceP/4c95814899ae8d647aa2cb37f75dd330 to your computer and use it in GitHub Desktop.
Repair Cockpit Updates On Ubuntu Server 20.04
#!/usr/bin/env bash
# netplan2NM.sh
# Ubuntu server 20.04 Change from netplan to NetworkManager for all interfaces
echo 'Changing netplan to NetworkManager on all interfaces'
# backup existing yaml file
cd /etc/netplan
cp 01-netcfg.yaml 01-netcfg.yaml.BAK
# re-write the yaml file
cat << EOF > /etc/netplan/01-netcfg.yaml
# This file describe the network interfaces available on your system
# For more information, see netplan(5).
network:
version: 2
renderer: NetworkManager
EOF
# setup netplan for NM
netplan generate
netplan apply
# make sure NM is running
systemctl enable NetworkManager.service
systemctl restart NetworkManager.service
echo 'Done!'
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment