Ubuntu – Wifi doesn’t work after suspend after 16.04 upgrade

16.04gnome-classicnetworkingwireless

This particular version of the "doesn't work after suspend" came after upgrading to 16.04. It seems that the upgrade includes a Wicd applet (added to Metacity Classic Gnome task bar alongside regular network icon), but doesn't seem to work after a suspend. A sudo service network-manager restart duplicates this problem. It takes a complete reboot to get Wifi going again. Any ideas why?

Best Answer

16.04 runs on systemd. Try the following:

sudo systemctl restart network-manager.service

If this works, you can create a script to automate it.

Open a terminal and type the following:

sudo nano /etc/systemd/system/wifi-resume.service Now paste the script in there with a right click. Exit with CTRL + X and press Y to save. Now to activate it: sudo systemctl enable wifi-resume.service

Script:

#/etc/systemd/system/wifi-resume.service
#sudo systemctl enable wifi-resume.service
[Unit]
Description=Restart networkmanager at resume
After=suspend.target
After=hibernate.target
After=hybrid-sleep.target

[Service]
Type=oneshot
ExecStart=/bin/systemctl restart network-manager.service

[Install]
WantedBy=suspend.target
WantedBy=hibernate.target
WantedBy=hybrid-sleep.target

Hope this helps. It works on my laptop.