How to uninstall the NVIDIA drivers on Ubuntu 20.04

How to uninstall the NVIDIA drivers on Ubuntu 20.04, and switch back to the opensource Nouveau Nvidia drivers.

Step 1 The following command will remove the proprietary Nvidia driver:

$ sudo dpkg -P $(dpkg -l | grep nvidia-driver | awk '{print $2}') $ sudo apt autoremove

Step 2 Switch back to nouveau driver:

$ sudo apt install xserver-xorg-video-nouveau

Step 3 Reboot:

$ reboot