What solved my problem (for now and hopefully for good!) is Yufenyuy Veyeh Dider's answer, but I am posting my own answer to explain in detail what I did.
Since I had no wireless or ethernet I found the right package on another machine and copied it to my PC via usb.
In my case the package was this one, amd64 architecture because it's a 64 bit machine. Double clicking the package opened the software center but it wouldn't let me install it citing This requires installation of untrusted packages.
I searched online and found that you can install deb
files by the following command:
sudo dpkg -i DEB_PACKAGE_NAME
which I did but another package dkms
was requested and failed to fetch since I have no internet connection. The name of it was dkms_2.2.0.3-2ubuntu6.1_all.deb
so I found it the same way as the bcmwl-kernel-source
and installed it using sudo dpkg -i dkms_2.2.0.3-2ubuntu6.1_all.deb
. After it installed, I installed the original package bcmwl-kernel-source
and my wireless started working again!
I hope this is the end of it. But I have no idea why this happened out of the blue, when wireless was working perfectly an hour ago.
rfkill list all
now lists:
0:phy0: Wireless LAN
1:brcmwl-0: Wireless LAN
2:hci0: Bluetooth
ifconfig -a
lists:
lo
wlp13so
sudo lshw -c network
lists an ethernet controller and a wireless interface.
Does that mean that everything is as it should be?
I have no idea why this happened in the first place, I hope my answer helps anyone with the same problem.
Again thanks Yufenyuy Veyeh Dider!
lspci -nnk | grep 0280 -A2
Write down the result and post it here as an edit to your question.