In my raspberry pi 3, I ran this command:

sudo apt-get remove network-manager network-manager-gnome openvpn openvpn-systemd-resolved network-manager-openvpn network-manager-openvpn-gnome

After that, I lost internet connection, I can't see wlan0 anymore on ifconfig...

I can't find any /etc/dhcpcd.conf file

Now, I could reinstall network-manager and network-manager-gnome with USB, but I still don't have internet. I can see wlan0 when I do ifconfig, but it has no ip.

When I try to set wifi country, it says:

Could not communicate with wpa_supplicant

I don't really know how to solve this one...

  • Did you used network manager before? network manager isn't supported by Raspbian by default. Do you use Raspbian? – Ingo Jan 31 at 22:14

It might be that just the systemd-file for dhcpcd is missing. Is there a dhcpcd on the system? Try ls /sbin. If so, try the following:

1) In /etc/dhcpcd.conf, put:

interface eth0
static ip_address=
static routers=
static domain_name_servers=
interface wlan0
static ip_address=
static routers=
static domain_name_servers=

(replace the IP adresses of the server, gateway and name server with your own)

2) in /etc/wpa_supplicant/wpa_supplicant.conf put the following

ctrl_interface=DIR=/var/run/wpa_supplicant GROUP=netdev

(replacing the ssid and psk with your own)

3) Make sure the systemd-service file exists in /etc/systemd/system/dhcpcd5.service; it should contain:

Description=dhcpcd on all interfaces

ExecStart=/usr/lib/dhcpcd5/dhcpcd -q -b
ExecStop=/sbin/dhcpcd -x


and 4) cycle the dhcpcd.

If not, create a wpa_supplicant.conf:


And then:

ifconfig wlan0 down
iwconfig wlan0 mode managed
ifconfig wlan0 up
iwconfig wlan0 essid 'yoyrSSID'
iwconfig wlan0 ap 00:11:22:33:44:55

wpa_supplicant -Dnl80211 -iwlan0  -c./wpa_supplicant.conf 

If iwconfig or wpa_supplicabnt are missing, you will not be able to set-up WiFi. Try to connect with a cable, even if it's just temporarily.

Failing that, I would suggest taking out the SD card and on a different computer:

  • backup all user data
  • re-install Raspian (or your favourite distro)
  • restore tha user-data

And move from a clean installation.

  • Please read also the headline. There is no dhcpcd. And the OP seems not like to answer questions to clarify it. – Ingo Feb 3 at 20:12
  • Right. Sorry. Edited the answer accordingly. – Ljm Dullaart Feb 4 at 18: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.