This tutorial is a rewritten of the previous ‘Fix ‘No WiFi Adapter Found’ for HP Laptops with Ubuntu 18.04‘, since wireless will stop working after installed or upgraded to a new Linux Kernel.
Following steps will install the newest Realtek rtlwifi codes including rtl8192ce, rtl8192cu, rtl8192se, rtl8192de, rtl8188ee, rtl8192ee, rtl8723ae, rtl8723be, rtl8821ae, rtl8822be and rtl8723de in Ubuntu with DKMS (Dynamic Kernel Module Support) support. So it will work in each kernel on your system.
1. Connect your laptop to a wired network, and then open terminal from application menu.
2. Run command to install some required tools:
sudo apt install git build-essential dkms
Type user password (no asterisk feedback due to security reason) when it prompts and hit Enter.
3. Now grab the rtlwifi_new codes via command:
git clone -b extended https://github.com/lwfinger/rtlwifi_new.git
4. Add the source to the tree for builds with DKMS support.
sudo dkms add ./rtlwifi_new
5. Finally install the drivers via command:
sudo dkms install rtlwifi-new/0.6
6. If everything works OK, Wifi should work immediately (it works in my case in Ubuntu 19.04).
If not, try commands to load the new installed module (rtl8723de in the case):
sudo modprobe -r rtl8723de && sudo modprobe rtl8723de
7. And Wifi works after reboot without doing any configuration, at least in my case in Ubuntu 19.04.
If not, try command to write it into configuration file (replace 3 to 1, 2 or 4 if signal is weak).
echo "options rtl8723de ant_sel=3" | sudo tee /etc/modprobe.d/rtl8723de.conf
In addition, if you happened to update your system with newest Kernel packages without reboot. You need to reinstall the kernel packages to get the module work after reboot.