WiFi isn't working in new installation of Ubuntu [duplicate]

It's Linux and everything should be setup manually, but I'm new to this and need help in setting up my WiFi.

here's what I did. I installed ubuntu, tried to connect the WiFi while installation it didn't got connected, I thought well it'll connect once it got installed but it still isn't connected. I think it should be pretty easy to solve, something I forgot to tick or something

a thing to notice is that it says it's connecting for few seconds and doesn't get connected after that


All you need to do is Open a terminal by pressing Ctrl + Alt + T and run:

gksu gedit /etc/NetworkManager/NetworkManager.conf

At the bottom of this file, copy and paste the following:

[device]
wifi.scan-rand-mac-address=no

final result will look like this

[main]
plugins=ifupdown,keyfile

[ifupdown]
managed=false

[device]
wifi.scan-rand-mac-address=no

Then just save and close the file and run:

sudo service network-manager restart

And wifi should work again!