I do not want to see the following message when I login to my Pi (5.10.17-v8+ #1403 SMP PREEMPT Mon Feb 22 11:37:54 GMT 2021 aarch64 GNU/Linux):

Wi-Fi is currently blocked by rfkill.
Use raspi-config to set the country before use.

How can I make it so that this message does not show up when I login by SSH?

  • 3
    Have a look in /etc/profile.d/wifi-check.sh
    – alin
    Commented Nov 1, 2021 at 22:14
  • A way to do this non-interactively would be nice. I don't mean CLI, I mean by writing to bootfs. Use case: I have a Pi 3A+, no screen, no keyboard. I had to run sudo rfkill unblock wifi (thanks @Kingsley) from the UART interface.
    – Gauthier
    Commented Apr 10, 2023 at 17:50

7 Answers 7


Run sudo raspi-config and set the wifi country code by going to

5 Localisation Options


L4. WLAN Country

Then select your country code from the list

  • 1
    Do you know of a way to do this programmatically? Commented Apr 11, 2021 at 1:32
  • 11
    @GordonFogus - yes - you can use raspi-config non-interactively ... sudo raspi-config nonint do_wifi_country XX - use appropriate value for XX Commented Apr 11, 2021 at 2:58
  • 1
    But that doesn't just disable the message, it also enables WiFi, which is not what the question is about (and probably not the intention of the OP). Commented Sep 27, 2023 at 8:30
  • and yet, @12431234123412341234123 this answer got more upvotes than any other answer Commented Sep 27, 2023 at 8:48

I'm stealing/promoting @Jaromanda X's answer here, as it's a one-liner and avoids having to fumble through the "GUI" to set the Wi-Fi region/country:

sudo raspi-config nonint do_wifi_country XX

XX is country code, you can find your country's code here: https://en.wikipedia.org/wiki/ISO_3166-1


I updated a Pi 3b to Bullseye and had this issue. I tried the country code and the urfkill installation and the rfkill unblock command. In the end, I also needed to run

sudo connmanctl enable wifi

This is described at the following: connman unable to connect to wifi: No carrier


The easiest way (that I've found) to programmatically make this message go away was to add the following to /boot/config.txt:


Yes, this does disable WiFi, but that was not a constraint in the original question (in other words, the question didn't say that disabling WiFi was unacceptable).

While I was at it, I also disabled Bluetooth, since I didn't need that either:

  • Indeed, it's notable that OP is logging in via ssh and therefore has some other kind of networking configured and working.
    – Ed Randall
    Commented Mar 16, 2022 at 8:52

No matter what I tried the raspi-config always failed with:

Could not communicate with wpa_supplicant

I already had the country code in the /etc/wpa_applicant/wpa_applicant.conf too.

In the end I used the rfkill command to enable it manually.

# rfkill unblock wifi

This seems to preserve the unblocked status, at least through warm-reboots.

Then (with quite a bit more stuffing around) it all worked.

It's a bit of a shame the "out-of-box" configuration scripts can't get this working.

  • 1
    You can check this status with rfkill list and you'll see Soft blocked: yes against the device. The unblocked status is saved in a file under /var/lib/systemd/rfkill/ and so survives a cold reboot. The point of this is to prevent unconfigured wifi transmitting on wrong frequencies for the country it's operating in.
    – Ed Randall
    Commented Mar 16, 2022 at 8:02
  • @EdRandall But if the user sets country in wpa_supplicant.conf, shouldn't that give the OS a hint?
    – Gauthier
    Commented Apr 10, 2023 at 17:26
  • @Gauthier agree, one would expect so. Seems like a bug that the file under /var/lib/systemd/rfkill/ wins out, but perhaps there are other good reasons that they do it that way.
    – Ed Randall
    Commented Apr 11, 2023 at 10:56
  • 1
    The country code is supposed to go in /etc/default/crda
    – OrangeDog
    Commented Oct 12, 2023 at 9:59
  • @OrangeDog - Use of crda has been deprecated in a few Linux distro's, so YMMV. Particularly if you're reading this in the future.
    – Kingsley
    Commented Oct 12, 2023 at 22:28

I encountered this problem setting up my Pi 4 with the 2021-10-30 version of Bullseye Lite. The howto I followed had a wpa_supplicant.conf file that started with:

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

and when I hooked up via Ethernet, rfkill complained that the country code was invalid. I used raspi-config to "update" it with the same value, and the first three lines came out as:

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

The WiFi started working correctly.

When I used the changed sequence on my Pi Zero W, it worked correctly the first time.

Looks like some code in the startup software is fussy about the order in which it finds parameters.


You might consider install urfkill, as in:

sudo apt install urfkill
sudo rfkill unblock wifi

That worked for me:


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