Hi guys. Please help. I've been searching for days and this is driving me insane. I have two SD cards; one with Ubuntu MATE and one with raspbian lite. I've installed MATE and wicd and their dependencies along with the usual updates but THAT'S IT so far as I'm trying to troubleshoot this issue. The WiFi works flawlessly in Ubuntu, but in lite I can't get it to work and the thing is driving me nuts. Eth0 works just fine. The only info I have is every solution I've tried hasn't worked, the OS seems to completely ignore the interface configs I made in /etc/network interfaces while I was troubleshooting, wlan0 reads on ifconfig as an ethernet device, scanning works but running ifdown yields an invalid interface error. Trying to power off the adapter with systemctl resulted in an invalid device error, and it's nothing recognised on lsusb HOWEVER an unknown device is. Dmesg also returns a string of errors which you can see below.

I changed /etc/network/interfaces while troubleshooting as it was suggested by another solution. I backed the original up as /etc/network/interfaces.old anyway so it can be easily restored to factory default, however the WiFi didn't work before and still doesn't. When adding an ssid and psk to wpa_supplicant.conf, the interface wlan0 is still recognised by ifconfig as ethernet. However, running ifup or ifdown wlan0 returns an unknown interface error.

I use the lite version because I don't like the full version's GUI and I find the version as a whole has a lot of bugs and problems. Thus I like to put my own software packages on, which also allows me to taylor the OS to my needs.

This is the only issue I'm having so far with lite and MATE. But it's a big issue as I often turn to wifi when I need the LAN cable for other devices or when I'm out on business presentations which I use my pi for as it's lightning-fast boot and load times make it ideal.

I have Lite set as an AP. I'm using the full version now with two wifi interfaces, one as an AP, and the other as a backup internet connection (station). Both the ethernet and the client wifi will hotplug.

I've done this with Jessie and Stretch. Which are you having problems with?

(Note the shorter "apt" command -- hope that works in Mate! "apt-get" should still work, too.)

"If it ain't broke, fix it until it is."
“Raspberry Pi is a trademark of the Raspberry Pi Foundation”
The Pink Unicorn is a symbol of commitment to sensible discussion of future versions of the Raspberry Pi ™

Here is what you need to do to connect to your WiFi with either the Desktop or Lite version of Raspbian at first boot.

Download one of the Raspbian images (desktop or lite) and use Etcher to write it to an SD card. There is no need to format the card or extract the image prior to using Etcher. Etcher can write the image directly from the archive, and the file system is contained in the image.

If you have trouble writing the image, verify the download with the published SHA-256 checksum from the download page. There is a nice little Windows shell extension called HashCheck that adds a checksums tab to file properties which you can use to check the downloaded file.

When Etcher has successfully written and verified the card it will safely eject it. Unplug the card or card reader and plug it back in so your computer will see the small FAT32 formatted boot partition.

If you want to enable SSH create an empty file named "ssh" or "ssh.txt" on the small FAT32 boot partition of the SD card.

To connect to a wireless router create another file called "wpa_supplicant.conf" which contains the following info.

Edit the country code, SSID and the WPA/WPA2 key with the info you need to connect to your network.

Note to SurferTim: The minimal wpa_supplicant.conf you're recommending that used to work with Jessie does not work with Stretch.

If you are using an ethernet cable to connect to your router you can skip that second file.

Safely eject the card from your computer and use it to boot the Raspberry Pi. When Raspbian finds the "ssh" file it will enable SSH and delete the file. When Raspbian finds the wpa_supplicant.conf file it will move it to the correct location and connect to your router.

Hi
I recently installed the latest raspbian Stretch version. I am having issues running the in-built Wifi. I edited the wpa_supplicant.conf file by adding my network (ssid, psk, key_mgmt) and updating the country to US.

The ifconfig does not show wlan0 interface running. It shows eth0(as I had ethernet cable attached) and lo interface.

When I tried :sudo iwlist wlan0 scan
I get:wlan0 Interface doesn’t support scanning