I'm trying to connect via Wi-Fi and to do so I have to disable dhcpcd but I couldn't. I tried:

sudo update-rc.d -f dhcpcd disable

But it didn't work I also tried to remove it using:

sudo update-rc.d -f dhcpcd remove

It still didn't work, any idea how to do so?


sudo systemctl stop dhcpcd.service will stop (deactivate) dhcpcd
sudo systemctl disable dhcpcd.service will prevent it from restarting.

Having said the above, I think this is a bad idea. There are a few different network managers in use on Pi under Linux. dhcpcd performs well, and has been chosen by the Foundation for good reasons.

On another point, you should get used to systemd. It is now used by most GNU/Linux distributions. sysV is still partially used, but on the way out.

| improve this answer | |
  • It gave some warnings but it worked. – B.rayane May 18 '17 at 9:53

This is not a direct answer but going to be useful to anyone trying to set up their raspberry pi to use static IP, because /etc/dhcpcd.conf will in fact change the IP of raspberry PI, even if you set a static profile, if another device is using that IP on the network. This can be a big security issue for some projects.

In addition to disabling dhcpcd using systemctl, you can set a static IP by editing /etc/network/interfaces

The latest Raspbian distributions ship with this file empty, but I tested that after disabling dhcpcd, you can set the static IP you want to use by adding this to the end of /etc/network/interfaces file

auto eth0
iface eth0 inet static
| improve this answer | |
  • Thanks for the clarification – B.rayane Apr 24 at 10:24

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.