Touchpad and WiFi stopped working on Ubuntu

The last thing I remember about using this laptop was that bluetooth had stopped working. Even though it worked when I booted up Windows 8. I remember fiddling around with scripts I did not understand. So when I booted up my old laptop weeks later, I found that mouse(touchpad) and WiFi were dead too. What's more, everything worked fine on Windows.

Let's cut to the chase. Since I did not have a working internet connection on the laptop(in Ubuntu), I wondered if I could reinstall the touchpad packages and opened up Synpatic Package Manager, which gave me an error asking me to run the following

> sudo dpkg --configure -a 

I ran it and rebooted Ubuntu. Mouse and Wifi started working after restarting the system.