Q:

"Enable Wifi" not showing

I recently used sudo apt-get autoremove command and after that "Enable Wifi" option is not showing.
$ lspci -knn | grep Net -A3
02:00.0 Network controller [0280]: Realtek Semiconductor Co., Ltd. RTL8821AE 802.11ac PCIe Wireless Network Adapter [10ec:8821]
    Subsystem: Lenovo RTL8821AE 802.11ac PCIe Wireless Network Adapter [17aa:a814]
    Kernel modules: rtl8821ae, wl

$ iwconfig is
lo no wireless extensions.

enp1s0    no wireless extensions.

From /var/apt/history.log:
Start-Date: 2017-11-06  01:15:38
Commandline: apt-get autoremove
Requested-By: praveen (1000)
Remove: linux-headers-4.10.0-28-generic:amd64 (4.10.0-28.32~16.04.2), librpmsign3:amd64 (4.12.0.1+dfsg1-3build3), linux-image-extra-4.10.0-33-generic:amd64 (4.10.0-33.37~16.04.1),
librpmbuild3:amd64 (4.12.0.1+dfsg1-3build3),
linux-image-extra-4.10.0-35-generic:amd64 (4.10.0-35.39~16.04.1),
debugedit:amd64 (4.12.0.1+dfsg1-3build3),
linux-headers-4.10.0-33-generic:amd64 (4.10.0-33.37~16.04.1),
linux-image-4.10.0-28-generic:amd64 (4.10.0-28.32~16.04.2),
linux-headers-4.10.0-35-generic:amd64 (4.10.0-35.39~16.04.1),
rpm:amd64 (4.12.0.1+dfsg1-3build3),
linux-image-4.10.0-33-generic:amd64 (4.10.0-33.37~16.04.1),
linux-headers-4.10.0-28:amd64 (4.10.0-28.32~16.04.2),
linux-headers-4.10.0-33:amd64 (4.10.0-33.37~16.04.1),
linux-headers-4.10.0-35:amd64 (4.10.0-35.39~16.04.1),
linux-image-4.10.0-35-generic:amd64 (4.10.0-35.39~16.04.1),
linux-image-extra-4.10.0-28-generic:amd64 (4.10.0-28.32~16.04.2)
End-Date: 2017-11-06  01:17:19

Output of uname -a:
Linux praveen-Lenovo-ideapad-300-15ISK 4.10.0-38-generic #42~16.04.1-Ubuntu SMP Tue Oct 10 16:32:20 UTC 2017 x86_64 x86_64 x86_64 GNU/Linux

$ dpkg-query -Wf '${db:Status-Abbrev} ${Package;-40} ${Version}\n' linux-{image,headers}-\* | grep '^i'
ii  linux-headers-4.10.0-37                  4.10.0-37.41~16.04.1
ii  linux-headers-4.10.0-37-generic          4.10.0-37.41~16.04.1
ii  linux-headers-4.10.0-38                  4.10.0-38.42~16.04.1
ii  linux-headers-4.10.0-38-generic          4.10.0-38.42~16.04.1
ii  linux-headers-4.4.0-98                   4.4.0-98.121
ii  linux-headers-4.4.0-98-generic           4.4.0-98.121
ii  linux-headers-generic                    4.4.0.98.103
ii  linux-headers-generic-hwe-16.04          4.10.0.38.40
ii  linux-image-4.10.0-37-generic            4.10.0-37.41~16.04.1
ii  linux-image-4.10.0-38-generic            4.10.0-38.42~16.04.1
ii  linux-image-extra-4.10.0-37-generic      4.10.0-37.41~16.04.1
ii  linux-image-extra-4.10.0-38-generic      4.10.0-38.42~16.04.1
ii  linux-image-generic-hwe-16.04            4.10.0.38.40

A:

These commands will work for
rtl8192ce, rtl8192se, rtl8192de, rtl8188ee, rtl8192ee, rtl8723ae, rtl8723be, and rtl8821ae. If you have any other driver then please search and install.
sudo apt-get install linux-headers-generic build-essential git 
git clone http://github.com/lwfinger/rtlwifi_new.git
cd rtlwifi_new
make
sudo make install

After that if your system does not load appropriate kernel module,you can run below command in same directory(make sure to run this for your specific driver in my case it is rtl8821ae):
sudo modprobe rtl8821ae

