20

Before upgrading I could use sudo service network-manager restart when having connection issues. After upgrading to 21.10 the network-manager is still installed, but not as a service anymore. Restarting the "networking" service instead seems not to have the same effects (and didn't had before in 20.04).

How do I restart the network-manager in 21.10?

Eugene
  • 1,646
  • From the package file list, it looks like it's NetworkManager.service now, in line with how it's in other distros. – muru Oct 24 '21 at 11:36
  • @muru Tried it, seems not to exist under this name :-( sudo service NetworkManager.service status "Unit NetworkManager.service.service could not be found." – Eugene Oct 24 '21 at 11:50
  • I see the service cmd has a --status-all flag which allows to retrieve a list of all services. Network manager is not listed there, only "networking" again. Seems there's no service for it anymore or it has been consolidated and working differently now somehow. – Eugene Oct 24 '21 at 11:55
  • After taking a look at the files in the list @muru has linked, I see in /lib/systemd/system/NetworkManager.service: ExecStart=/usr/sbin/NetworkManager --no-daemon. What I now do to restart it is sudo killall NetworkManager + sudo NetworkManager --no-daemon &. Seems to do what the service restart did before. – Eugene Oct 24 '21 at 12:22
  • 3
    See the output from your first command: NetworkManager.service.service with two .services in it. When using the service command, you shouldn't put have .service sudo service NetworkManager status. – muru Oct 24 '21 at 12:27
  • I have this issue on my ubuntu server, but NetworkManager can't be found on the system and is not loaded... very tedious/confusing for a linux newbie – Reahreic Sep 06 '24 at 00:28

1 Answers1

28

The NetworkManager service has been named NetworkManager for a while now, and network-manager service was kept around as a backwards-compatibility option (see What's the difference between network-manager.service and NetworkManager.service in Systemd?). It looks like that was finally dropped in Ubuntu 20.10 (Groovy Gorilla), and now only the NetworkManager name remains. You can use it like so:

sudo service NetworkManager start|stop|...
sudo systemctl start|stop|... NetworkManager
sudo systemctl start|stop|... NetworkManager.service
N0rbert
  • 103,523
muru
  • 207,970
  • As all Linux things, this is case sensitive so NetworkManager works but networkmanager does not and will reply Unit file networkmanager.service does not exist. This is pretty confusing as all services on ubuntu last MANY years have all been lowercase and I always type lowercase. Luckily I've used copy/paste from your answer, so you get my upvote, but you may want to update the answer with they case sensitive notice. Thanks! – LuxZg Nov 23 '22 at 09:21
  • Referencing this thread for a similar problem with 23.10:

    sudo service NetworkManager start Job for NetworkManager.service failed because the control process exited with error code. See "systemctl status NetworkManager.service" and "journalctl -xeu NetworkManager.service" for details.

    – DonP Apr 12 '24 at 18:42
  • Nice answer, but what a crap for ubuntu to change the service name to NetworkManager – Eric Mar 01 '25 at 15:52
  • @Eric I'm pretty sure the change was upstream, and Ubuntu only kept around the old name as a temporary compatibility measure. – muru Mar 02 '25 at 00:40