Skip to content

raspi-config

15 commands

The Raspberry Pi configuration tool, interactive or scriptable: enable interfaces, set locale, expand storage and tune boot options.

  • Raspberry Pi
  • configuration

Install raspi-config

sudo apt install raspi-config

Interactive1

sudo raspi-config

Opens the menu-driven configuration tool for interfaces, localisation, display, performance and updates.

Non-interactive10

sudo raspi-config nonint do_ssh 0

Enables SSH. In nonint mode 0 means enable and 1 means disable.

sudo raspi-config nonint do_i2c 0

Enables the I²C interface.

sudo raspi-config nonint do_spi 0

Enables SPI.

sudo raspi-config nonint do_serial_hw 0

Enables the hardware serial port.

Link
sudo raspi-config nonint do_serial_cons 1

Disables the login console on serial so the UART is free for devices.

Link
sudo raspi-config nonint do_hostname <name>

Sets the hostname.

Link
sudo raspi-config nonint do_wifi_country <cc>

Sets the Wi-Fi regulatory country; Wi-Fi stays blocked until this is set.

Link
sudo raspi-config nonint do_change_timezone <tz>

Sets the timezone.

Link
sudo raspi-config nonint do_boot_behaviour B1

Boots to a console without auto-login. B2 is console with auto-login, B3 desktop, B4 desktop with auto-login.

sudo raspi-config nonint do_expand_rootfs

Expands the root file system to fill the SD card on the next boot.

Querying4

sudo raspi-config nonint get_ssh

Prints 0 if SSH is enabled and 1 if not.

Link
sudo raspi-config nonint get_i2c

Reports whether I²C is enabled.

Link
sudo raspi-config nonint get_hostname

Prints the configured hostname.

Link
cat /boot/firmware/config.txt

The firmware configuration file most raspi-config options write to (/boot/config.txt on older releases).

Link