Ubuntu 11.10 Oneric

Things are much easier now. Install the xserver-xorg-video-nouveau package. It won't uninstall the proprietary nvidia drivers.

To switch to nouveau, go to System Settings / Additional Drivers. Click the activated driver, which is probably "NVIDIA accelerated graphics driver (version current)[Recommended]". Click "Remove". With all of these proprietary drivers deactivated and the xserver-xorg-video-nouveau package installed, it will automatically use nouveau. Copy your /etc/X11/xorg.conf to a backup. Edit /etc/X11/xorg.conf to change the Driver from "nvidia" to "nouveau". Reboot.

The minimal /etc/X11/xorg.conf file, which you should try, if you encounter any problems, is:

Section "Device"
Identifier "n"
Driver "nouveau"
EndSection

To revert these changes, just do the opposite. Go to System Settings / Additional Drivers. Click "NVIDIA accelerated graphics driver (version current)[Recommended]". Click "activate". Restore your backup copy of xorg.conf, or edit it to change the Driver from "nouveau" to "nvidia". Reboot. You don't need to uninstall xserver-xorg-video-nouveau.

Warning for older releases (before Oneric?)

Nvidia's proprietary libglx module is incompatible to the standard libglx module which is needed for free and open-source drivers such as nouveau.

Therefore, attempting to install the Ubuntu nouveau package will remove the nvidia-glx-* package from the system, making your installation of the proprietary nVidia driver unusable.

You'll have to reinstall it using apt-get in case you want to the proprietary nVidia driver is a requirement for this. If you are using the Ubuntu packages the xserver-xorg-video-nouveau package will automatically remove the nvidia-glx-* package when it is installed and the nvidia-glx packages will automatically remove the nouveau package when it is installed. You may wish to remove it manually using the restricted manager and then restart.

If you installed the nVidia driver (as downloaded from nvidia.com) manually, this will break your nVidia driver install, and it will need to be reinstalled if you wish to use it again. In that case, ensure that you have a working proprietary nVidia driver installation (e.g. NVIDIA-Linux-x86-190.53-pkg1.run) on your machine(s) before you attempt to install nouveau, because for downloading it from nvidia.com, you need a working JavaScript-capable browser, and re-downloading will be hairy if you are not able to start X because of a broken xorg server installation.

Packages in Ubuntu archive

From Jaunty onwards there are nouveau packages in the Universe archive. Just install xserver-xorg-video-nouveau. These are built for all architectures supported by Ubuntu, but are not neccesarily up to date. For example, the nouveau package for Ubuntu 9.04 is dated from the month of the 9.04 release, April 2009. More up to date packages are available for x86 and amd64 in the xorg-edgers PPA or upgrade your distribution (ALT-F2 and then "update-manager -d") to Lucid (alpha) which has a recent nouveau driver release set as the default.

Packages and Live-ISO images for Ubuntu 9.10 and 10.4 in the xorg-edgers PPA archive

Xorg.config

You will then need to select the nouveau driver in your /etc/X11/xorg.conf file. Enter it manually like this:

Section "Device"
...
driver "nouveau"
EndSection

Note that Karmic (9.10) does not have an /etc/X11/xorg.conf file by default. It is created as follows:

sudo Xorg -configure

That creates a file, xorg.conf.new in ~/ (the home dir of the user). Check the file to make sure it contains 'driver "nouveau"' as above. If not, edit it to add the line. Then copy to the right location and name:

sudo cp $HOME/xorg.conf.new /etc/X11/xorg.conf

Reboot. If it is still not using the driver, use:

sudo dpkg-reconfigure -phigh xserver-xorg

and reboot.

Uninstalling

Reverting back to the proprietary nVidia drivers should be as simple as reinstalling the appropriate nvidia-glx{,-new,-legacy} package, reverting the xorg.conf change and uninstalling the nouveau packages e.g. (found using dpkg -l|grep nouveau) using dpkg -P. This will leave a git snapshot package of libdrm2 on your system, but that shouldn't cause problems. To revert completely, remove the PPA from your apt sources and downgrade the libdrm2 (and possibly libdrm-dev) package.