Fix Wifi after suspend (Ubuntu 16.04 / ‘Device not ready’)
On Ubuntu 16.04, Wifi occasionally gets stuck after suspend on my laptop.
Running sudo systemctl restart network-manager.service
fixes it.
To have this run automatically after resume, open a command line and type:
sudo nano /etc/systemd/system/wifi-resume.service
Now paste the below script in there with a right click, and exit by pressing CTRL + X and press Y to save.
Now to activate the service:
sudo systemctl enable wifi-resume.service
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 |
#/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 |
Found here