How to permanently install WiFi driver Realtek 8723DE in Ubuntu 18.04

Solution 1:

Ok, I managed to solve the problem by doing the following:

1) In the BIOS boot options disabled the Secure Boot option.

2) Remove and reinstall the driver with these commands:

sudo dkms remove rtl8723de/5.1.1.8_21285.20171026_COEX20170111-1414 --all
sudo dkms add ./rtl8723de
sudo dkms install rtl8723de/5.1.1.8_21285.20171026_COEX20170111-1414

3) At this point a UEFI Secure Boot configuration window pops up. Generate a Machine-Owner Key (MOK). Then follow with reboot:

sudo depmod -a
reboot

4) When reebooting, a blue screen appeares to confirm the change using the previously generated MOK. Select the "Enroll MOK" option and enter the key.

After reboot I have WiFi connectivity in Ubuntu 18 again. In my previous attemps to install this driver I was not aware of this MOK option. Hope this time the driver keeps installed permanently. Cheers!