1

The computer i am working on has a manual network configuration i need to keep. The DNS address has been written to file /etc/resolv.conf but the network manager rewrites a default configuration in it at every startup.

Notice i don't want to configure the network manager with this DNS address i would like to do it manually. is there a way i can stop the network manager permanently ? I already tried preventing it from rewriting on the file but that doesn't work.

1
  • 1
    chattr +i on the file will work for sure, in case you find the other NM features handy. Sep 30, 2014 at 18:09

2 Answers 2

0

Assuming Debian based distribution (Mint, Ubuntu),

apt-get remove network-manager

should do it :)

you then need to add network configuration in /etc/network/interfaces (see man interfaces).

You may need to apt-get install resolvconf for ifup to be able to populate /etc/resolv.conf. You can add IP and DNS stanzas in interfaces file if the settings are static.

Note that session managers may list network-manager as required, and refuse to start without it. You will have to remove it from the list of mandatory session components. I have done it long ago, don't remember where they are listed - search engine is your friend :)

3
  • 1
    the solution sound promising, but to remove the network-manager, i have to remove cinnamon (linux mint) and i don't really want that to happen. I have checked the other options suggested by apt and none sound better. Oct 1, 2014 at 6:56
  • cinamon is simply a metapackage and it is OK to remove it - this does not affect desktop environment. Just don't apt-get autoremove after you've done it - that WILL remove all desktop environment. Alternatively, you can leave network-manager as is, and just configure the interface in /etc/network. NM will recognize the interface as "unmanaged" and will leave it alone. Leaving NM installed is rather pointless in this case, but if you are afraid to touch cinamon...choose your poison :)
    – ArunasR
    Oct 1, 2014 at 12:13
  • @ArunasR "Just don't apt-get autoremove after you've done it" I'd like to be able to continue to use my system normally, including having apt clean up packages I don't need anymore. I.e., I'm having the same problem as OP.
    – Luc
    Jan 2, 2023 at 7:55
1

sudo systemctl disable NetworkManager

Alternatively, as Jonas Schäfer mentioned, chattr +i /etc/resolv.conf worked for me in the past to keep nm's fingers away from that file specifically while still letting it manage, for example, the WiFi card, but it's annoying to have to remember to -i it so that you can edit it when switching to another network.

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .