How fix hostapd invalid/unknown driver 'nl80211' error?

You need to build, or obtain, a different copy of hostapd. The one you have has been built with the option CONFIG_DRIVER_NL80211 set to N, rather than Y.

There are simple and detailed instructions how to rebuild it here → Hostapd building instruction. Rebuild it with the option enabled. You may have to google for hostapd.2.0.tar.gz, but do exactly as it mentioned in link.

As for the follow-up question/error try to install this library libssl-dev using this command:

sudo apt-get install libssl-dev

You see the spaces after the values? Remove them.

  • Line 2: invalid/unknown driver 'nl80211 '

  • Line 4: unknown hw_mode 'g '