I performed a routine update last week. The update manager crashed and I lost the Wifi.

The message is the following:

The package system is broken

Check if you are using third-party repositories. If so, disable them, because they are a common source of problems.
Furthermore, run the following command in a Terminal: apt-get install -f

The following packages have unmet dependencies:

linux-headers-generic: Depends: linux-headers-3.2.0-40-generic but it is not installed
linux-headers-generic-pae: Depends: linux-headers-3.2.0-40-generic-pae but it is not installed

How can I reinstall the wifi without performing a new Ubuntu installation or an upgrade? Or should I do an upgrade with 12.04.2? Or what else should I try?