34

Sometimes my network manager indicator (applet) shows as if I'm not connected to wifi (no bars) and when I right click it it says "networking disabled" although I am connected to the internet. Maybe it's a bug or something.

Running sudo service network-manager restart fixes this applet. It restarts the whole network. Does anyone know a simple way to restart just the applet? (nm-applet)

steoiatsl
  • 9,450
  • 28
  • 88
  • 150
  • Is there a bug in Launchpad for this issue that we can follow? I'm more interested in "curing the disease" than "treating the symptom", so to speak. – Ryan Mar 18 '17 at 18:17
  • 1
    I have the same problem in 16.04, and `sudo service network-manager restart` doesn't always fix it. For example, now the indicator shows zero "bars" and no network, even though I'm online typing this comment. [Screenshot](http://imgur.com/K1gemon). – Dan Dascalescu Apr 03 '17 at 20:33
  • 1
    @DanDascalescu see the accepted answer. use `killall nm-applet; nohup nm-applet &` – steoiatsl Apr 03 '17 at 20:46
  • @MinaMichael Thank you for the hint about `sudo service ____ restart` !! – isomorphismes Jul 29 '17 at 15:32

3 Answers3

60

You can restart nm-applet with this command from terminal:

killall nm-applet; nohup nm-applet &

or by restarting the network-manager service (which will restart nm-applet):

sudo systemctl restart network-manager

or

sudo service network-manager restart

In new Ubuntu 22.04 versions and upper:

sudo systemctl restart NetworkManager.service

Here is a YouTube video explaining the answer.

shakaran
  • 107
  • 5
panticz
  • 1,588
  • 13
  • 14
  • 4
    Perfect -- working on 16.04 still. – dpb May 15 '16 at 17:53
  • does the trick on 16.10 as well, fixing the not discovering new wifi on the xps 13 – Sideshowcoder Nov 08 '16 at 18:11
  • 1
    it doesn't work on 16.10. the app restarts but it does not show in taskbar. only works by restarting network-manager service. after killing nm-applet, not even restarting network manager shows it again, and I had to restart lightdm. – Zibri Dec 16 '16 at 09:42
  • Worked on 16.04.2, while `sudo service network-manager restart` didn't (it led to the indicator showing zero "bars" and no network, even though I'm online typing this comment. [Screenshot](http://imgur.com/K1gemon). – Dan Dascalescu Apr 03 '17 at 20:35
  • but, how I can do the `killall nm-applet && nohup nm-applet &` automatically after resume ? – Yonsy Solis Jul 17 '17 at 01:54
  • @YonsySolis I'll see if I can find the question and answer that covers that, but it is a udev or systemd power state rule IIRC. – dragon788 Sep 05 '17 at 21:41
  • I found `nm-applet` occupying the top 2 positions (sorted by CPU usage) in `htop` when I had a flaky Internet connection. The `killall` method seems to have cured both problems, thank you! – FKEinternet Jun 07 '19 at 19:38
  • `killall nm-applet && nohup nm-applet & && disown` -- Add disown to unhook executed job from the running shell. – pds Jan 13 '20 at 10:21
2

If you have gnome, restarting the shell (Alt-F2, r, Return) might do it.

Gremlin
  • 749
  • 7
  • 17
0

None of the accepted answer's suggestions worked for me in Ubuntu 16.04.5, but this did:

sudo killall -9 nm-applet && nm-applet &

The main difference seems to be sudo before killall.

mivk
  • 5,082
  • 1
  • 47
  • 56