Wifi not working in HP laptop RTL8723DE realtek wireless driver [duplicate]

Bought a new HP 15q laptop with FreeDOS. Installed Ubuntu 16.04 LTS and Wi-Fi icon is not showing in taskbar.

$ lspci -nnk | grep -iA2 net
01:00.0 Ethernet controller [0200]: Realtek Semiconductor Co., Ltd. RTL8111/8168/8411 PCI Express Gigabit Ethernet Controller [10ec:8168] (rev 15)
    DeviceName: Hanksville Gbe Lan Connection
    Subsystem: Hewlett-Packard Company RTL8111/8168/8411 PCI Express Gigabit Ethernet Controller [103c:8328]
    Kernel driver in use: r8169
    Kernel modules: r8169
02:00.0 Network controller [0280]: Realtek Semiconductor Co., Ltd. Device [10ec:d723]
    DeviceName: WLAN
    Subsystem: Hewlett-Packard Company Device [103c:8319]

My kernel version is 4.13.0. All answers seems to be outdated for my kernel version and also the official Realtek download site only supports up to kernel version 4.7.

If anyone has any idea how to go about this problem, please help me. I would be very much thankful to you for your support and any help will be heartily appreciated.


I am writing a more complete answer in order to explain the exact procedure for the benefit of the inevitable searchers.

Your kernel version is 4.13.0-xx. Accordingly, we will get the driver appropriate for kernel versions 4.11 and higher. With a temporary working internet connection by ethernet, tethered or whatever means possible, open a terminal and do:

sudo apt update
sudo apt install git dkms
git clone https://github.com/smlinux/rtl8723de.git -b 4.11-up
sudo dkms add ./rtl8723de
sudo dkms install rtl8723de/5.1.1.8_21285.20171026_COEX20170111-1414
sudo depmod -a

Reboot and your wireless should be working.