I would like to mention that this is my first time installing any Linux distribution so I don't have much experience. A few days ago I decided to install Ubuntu on my laptop that was just sitting around. I had some trouble with the install and when I finally got it installed I couldn't connect to Wi-Fi. Got the ethernet cable plugged in, googled the issue but none of the things I found were helpful. I tried running rfkill and this is what I got:
ID TYPE DEVICE SOFT HARD
0 bluetooth hci0 unblocked unblocked
1 wlan phy0 unblocked blocked
A common fix that I found was to use the Wi-Fi key, but my laptop does not have one (it has an airplane mode key but that didn't do anything) I also tried running
sudo rfkill unblock all
but that had no effect either. In the BIOS I didn't find anything Wi-Fi related. Everything worked fine until I got Ubuntu so I suppose it's not a hardware issue of any kind. I don't know how helpful this is but I will also mention I'm using a HP Omen (15t) laptop. In a few threads I saw people asking for lsmod so I'm going to put that here:
Module Size Used by
rfcomm 77824 4
cmac 16384 1
bnep 20480 2
ttm 106496 0
nls_iso8859_1 16384 1
snd_hda_codec_hdmi 49152 1
intel_rapl 20480 0
x86_pkg_temp_thermal 16384 0
intel_powerclamp 16384 0
snd_hda_codec_realtek 94208 1
snd_hda_codec_generic 73728 1 snd_hda_codec_realtek
coretemp 16384 0
kvm 593920 0
irqbypass 16384 1 kvm
snd_hda_intel 40960 3
snd_hda_codec 126976 4 snd_hda_intel,snd_hda_codec_hdmi,snd_hda_codec_generic,snd_hda_codec_realtek
snd_hda_core 81920 5 snd_hda_intel,snd_hda_codec,snd_hda_codec_hdmi,snd_hda_codec_generic,snd_hda_codec_realtek
crct10dif_pclmul 16384 0
snd_hwdep 20480 1 snd_hda_codec
crc32_pclmul 16384 0
snd_pcm 98304 4 snd_hda_intel,snd_hda_codec,snd_hda_core,snd_hda_codec_hdmi
snd_seq_midi 16384 0
snd_seq_midi_event 16384 1 snd_seq_midi
arc4 16384 2
ghash_clmulni_intel 16384 0
snd_rawmidi 32768 1 snd_seq_midi
uvcvideo 86016 0
videobuf2_vmalloc 16384 1 uvcvideo
videobuf2_memops 16384 1 videobuf2_vmalloc
videobuf2_v4l2 24576 1 uvcvideo
videobuf2_core 40960 2 uvcvideo,videobuf2_v4l2
pcbc 16384 0
joydev 24576 0
videodev 184320 3 uvcvideo,videobuf2_core,videobuf2_v4l2
iwlmvm 364544 0
media 40960 2 uvcvideo,videodev
mac80211 778240 1 iwlmvm
snd_seq 65536 2 snd_seq_midi_event,snd_seq_midi
snd_seq_device 16384 3 snd_seq,snd_rawmidi,snd_seq_midi
snd_timer 32768 2 snd_seq,snd_pcm
input_leds 16384 0
mac_hid 16384 0
iwlwifi 282624 1 iwlmvm
aesni_intel 188416 2
aes_x86_64 20480 1 aesni_intel
crypto_simd 16384 1 aesni_intel
glue_helper 16384 1 aesni_intel
cryptd 24576 3 crypto_simd,ghash_clmulni_intel,aesni_intel
snd 81920 17 snd_hda_intel,snd_hwdep,snd_seq,snd_hda_codec,snd_timer,snd_rawmidi,snd_hda_codec_hdmi,snd_hda_codec_generic,snd_seq_device,snd_hda_codec_realtek,snd_pcm
intel_cstate 20480 0
intel_rapl_perf 16384 0
processor_thermal_device 16384 0
btusb 45056 0
btrtl 16384 1 btusb
btbcm 16384 1 btusb
btintel 16384 1 btusb
bluetooth 548864 33 btrtl,btintel,bnep,btbcm,rfcomm,btusb
ecdh_generic 24576 2 bluetooth
serio_raw 16384 0
soundcore 16384 1 snd
cfg80211 622592 3 iwlmvm,iwlwifi,mac80211
mei_me 40960 0
int340x_thermal_zone 16384 1 processor_thermal_device
rtsx_pci_ms 20480 0
memstick 16384 1 rtsx_pci_ms
intel_pch_thermal 16384 0
intel_soc_dts_iosf 16384 1 processor_thermal_device
mei 90112 1 mei_me
shpchp 36864 0
sch_fq_codel 20480 2
parport_pc 36864 0
ppdev 20480 0
lp 20480 0
parport 49152 3 lp,parport_pc,ppdev
ip_tables 28672 0
x_tables 40960 1 ip_tables
autofs4 40960 2
i915 1617920 13
rtsx_pci_sdmmc 24576 0
video 45056 1 i915
i2c_algo_bit 16384 1 i915
psmouse 147456 0
r8169 86016 0
mii 16384 1 r8169
rtsx_pci 65536 2 rtsx_pci_sdmmc,rtsx_pci_ms
drm_kms_helper 172032 1 i915
ahci 36864 2
libahci 32768 1 ahci
syscopyarea 16384 1 drm_kms_helper
sysfillrect 16384 1 drm_kms_helper
sysimgblt 16384 1 drm_kms_helper
fb_sys_fops 16384 1 drm_kms_helper
drm 401408 7 i915,ttm,drm_kms_helper
ipmi_devintf 20480 0
ipmi_msghandler 53248 1 ipmi_devintf
EDIT: Output for
lspci -knn | grep Net -A3; rfkill list
04:00.0 Network controller [0280]: Intel Corporation Wireless 7265 [8086:095a] (rev 61)
Subsystem: Intel Corporation Dual Band Wireless-AC 7265 [8086:5010]
Kernel driver in use: iwlwifi
Kernel modules: iwlwifi
0: hci0: Bluetooth
Soft blocked: no
Hard blocked: no
1: phy0: Wireless LAN
Soft blocked: no
Hard blocked: yes
Edit 2: Tried turning airplane mode on, rebooted and turned it back off yet nothing changed probably because I did it from the OS because shortcut key for airplane mode doesn't work at all in Linux
Hard blocked: yes
indicates (at least to me) that the connection is blocked by hardware. This could be a switch, a key combo or a BIOS setting. Try turning airplane mode on, rebooting and then turning airplane mode off.