I installed Ubuntu Server 19.10 on a Raspberry Pi 4 with no ethernet connection available, and I was initially able to get it to connect to wifi with
dhclient. That allowed me to download and install lubuntu-desktop. Having started the desktop environment, though, it will no longer connect to wifi. If I try to connect through the GUI, it just keeps disconnecting and asking me for the password over and over again. Meanwhile, if I open a terminal and try to connect "manually" as I did the first time, I get the following output from
ioctl[SIOCSIWPMSKA]: Connection timed out ioctl[SIOCSIWENCODEEXT]: Invalid argument ioctl[SIOCSIWENCODEEXT]: Invalid argument ioctl[SIOCSIWPMSKA]: Connection timed out
sudo dhclient wlan0 just hangs indefinitely.
I have tried restarting the NetworkManager service, restarting the whole computer, and manually editing
/etc/network/interfaces as suggested here.
EDIT: I tried re-imaging my SD card, and verified that I could connect to WIFI on the terminal again. I then installed Ubuntu MATE instead of lubuntu, and now whenever I try to connect it just sits for a while and the gives me a notification saying "You have been disconnected". I can still connect via command line with
dhclient now, and Firefox works, but the system GUI remains unaware that it is in fact connected to WIFI.