Ubuntu Linux installed on a Lenovo laptop randomly disables wireless networks altogether. Subsequently, it does not show any wireless networks too in Network Manager.
To resolve this issue, did the following:
$ sudo lshw -class network <enter>
Below is the result.
Notice the logical name wlp2s0b1 and the driver brcmsmac
description: Wireless interface
product: BCM4313 802.11bgn Wireless Network Adapter
vendor: Broadcom Inc. and subsidiaries
physical id: 0
bus info: pci@0000:04:00.0
logical name: wlp2s0b1
width: 64 bits
capabilities: pm msi pciexpress bus_master cap_list ethernet physical wireless
configuration: broadcast=yes driver=brcmsmac driverversion=4.18.0-14-generic firmware=610.812 ip=220.127.116.11 latency=0 link=yes multicast=yes wireless=IEEE 802.11
resources: irq:18 memory:f0500000-f0503fff
$ sudo vi /etc/pm/config.d/config <enter>
Add below line to the file and save.
Restart network manager using
$ sudo service network-manager restart <enter>