-1

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
0

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=192.168.178.53/24
static routers=192.168.178.1
static domain_name_servers=192.168.178.6
interface wlan0
static ip_address=192.168.178.3/24
static routers=192.168.178.1
static domain_name_servers=192.168.178.6

(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

country=GB
ctrl_interface=DIR=/var/run/wpa_supplicant GROUP=netdev
update_config=1
network={
    ssid="ssidforwifi"
    psk="wifipsk"
}

(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:

[Unit]
Description=dhcpcd on all interfaces
Wants=network.target
Before=network.target

[Service]
Type=forking
PIDFile=/run/dhcpcd.pid
ExecStart=/usr/lib/dhcpcd5/dhcpcd -q -b
ExecStop=/sbin/dhcpcd -x

[Install]
WantedBy=multi-user.target
Alias=dhcpcd5.service

and 4) cycle the dhcpcd.

If not, create a wpa_supplicant.conf:

network={
    ssid="yourSSID"
    psk="youtPSK"
    priority=1
}

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 acknowledge that you have read our updated terms of service, privacy policy and cookie policy, and that your continued use of the website is subject to these policies.

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