Fixing the “sudo raspi‑config command not found” error on Raspberry Pi

Raspberry Pi devices are famous for their flexibility and the broad ecosystem of tutorials that help beginners get started. One of the handiest tools on Raspberry Pi OS is raspi‑config, a text‑based interface that lets you configure system options, update firmware, enable interfaces like SSH or I2C, and change localisation settings. According to the Raspberry Pi documentation, you can launch the tool from the desktop menu or directly from the terminal with the command sudo raspi‑config. Running it opens a menu that modifies configuration files such as /boot/firmware/config.txt.

However, users sometimes get a perplexing error: “sudo raspi‑config command not found.” This message appears when the shell cannot locate the raspi‑config script. Because the tool is essential for network setup, audio configuration and system updates, the error can derail projects until it is resolved. This guide explains why the error happens and provides step‑by‑step solutions to fix it.

What is raspi‑config and why is it important?

The raspi‑config utility is part of Raspberry Pi OS. It provides a text menu for configuring hardware and software settings without editing configuration files manually. When you run it, you can change boot behaviour, enable SSH, set the hostname, configure Wi‑Fi and audio, allocate GPU memory, expand the filesystem and overclock the processor. The tool is integrated with Raspberry Pi OS and is available in both the full desktop edition and the headless “Lite” edition. Because it interacts with system files, you must run it with superuser privileges.

Common reasons for the “command not found” error

  • Not running Raspberry Pi OS: The raspi‑config tool is only packaged with Raspberry Pi OS. If you are using a different distribution, such as Ubuntu or another Debian‑based system, the tool is absent.
  • Package not installed or removed: The tool might have been removed inadvertently during system cleanup, or the OS image you installed did not include it.
  • Incorrect PATH environment: Your shell looks for commands in directories listed in the PATH variable. If /usr/bin, where raspi‑config resides, is missing from PATH, the shell cannot find it.
  • Outdated or corrupted system files: An outdated OS, incomplete update or SD‑card corruption can cause missing tools and system instability.
  • Permissions issues: Running raspi‑config without sudo can produce different permission errors. In rare cases, users are not members of the sudo group and cannot run commands as root.
  • Custom scripts or configuration conflicts: Heavily customised images or third‑party scripts may remove or mask the tool.
Raspi-config Permission Error

Step‑by‑step solutions to fix the error

Select the scenario that matches your situation and follow the steps.

Install or reinstall raspi‑config (package missing)

Open a terminal and update package lists:

sudo apt update

Then install raspi‑config:

sudo apt install raspi-config

After installation, verify that the tool opens:

sudo raspi-config

This should open the blue configuration menu. If the command still fails, continue with the next solution.

Fix the PATH environment

Check whether raspi‑config is installed but not in your PATH:

which raspi-config

If you see something like /usr/bin/raspi-config, ensure that /usr/bin appears in the output of:

echo $PATH

If /usr/bin is missing, temporarily add it:

export PATH=$PATH:/usr/bin

For a permanent fix, edit the file ~/.bashrc and append:

export PATH=$PATH:/usr/bin

Save and close the file, then reload it or reboot the Pi:

source ~/.bashrc

or

sudo reboot

Afterwards, run sudo raspi-config again to ensure the problem is resolved.

Switch to Raspberry Pi OS

If you are using Ubuntu, Debian Bookworm or another distribution that does not bundle raspi‑config, consider switching to Raspberry Pi OS. Raspberry Pi OS includes the tool by default and is optimised for the hardware. To switch:

  • Download Raspberry Pi Imager from the official website.
  • Prepare a micro‑SD card and back up any important files.
  • Select Raspberry Pi OS (32‑bit or 64‑bit) in the imager, choose your SD card, and click “Write.”
  • Insert the SD card into your Raspberry Pi and boot. After setup, run sudo raspi-config to access the configuration tool.

Update an outdated or corrupted system

If your system is outdated or the SD card is corrupted, missing utilities like raspi‑config can occur. You can often fix this by updating and upgrading your OS:

sudo apt update
sudo apt full-upgrade

Should your SD card show signs of corruption (for example, repeated errors or a read‑only file system), replace the card and reinstall Raspberry Pi OS.

Resolve permissions problems

raspi‑config requires superuser privileges, so always run it with sudo. If you created a new user, add that user to the sudo group:

sudo usermod -aG sudo yourusername

Then log out and back in. Alternatively, you can open a root shell using:

sudo -i

or

sudo -s

but exercise caution when running commands as root.

Undo conflicting customisations

If you have installed third‑party scripts or made extensive changes to system files, those modifications may interfere with raspi‑config. Try the following:

  • Remove recently added scripts and custom services.
  • Restore default configuration files from backups.
  • If you cannot identify the conflict, back up your data and perform a clean installation of Raspberry Pi OS.

Additional tips and tricks

Once raspi‑config is working, consider these techniques to streamline configuration:

  • Use the non‑interactive mode: If you need to automate changes (for example, for scripts or large deployments), use sudo raspi-config nonint <command> <arguments>. This mode lets you enable SSH, set the hostname or configure Wi‑Fi without the interactive menu.
  • Check other configuration tools: Many options available in raspi‑config are also exposed in the graphical Raspberry Pi Configuration utility (Preferences ▶ Raspberry Pi Configuration). Some advanced features like overclocking are exclusive to raspi‑config.
  • Keep your system updated: Regularly run sudo apt update and sudo apt full-upgrade to keep raspi‑config and other system components up to date.
  • Document your changes: When making modifications through raspi‑config, note them in a project log. This helps diagnose issues later and improves reproducibility.

Conclusion

The raspi‑config tool is indispensable for configuring Raspberry Pi devices, and encountering a “command not found” error can be frustrating. Most issues stem from running an unsupported operating system, missing packages, incorrect PATH settings or corrupted installations. By following the steps in this guide—reinstalling the tool, fixing your PATH, switching to Raspberry Pi OS and keeping your system updated—you should be able to restore full functionality. Remember to run raspi‑config with sudo and take regular backups of your SD card to avoid data loss. With a reliable system and the right configuration tools, your Raspberry Pi projects will run smoothly.

Similar Posts

Leave a Reply

Your email address will not be published. Required fields are marked *