Whenever I flash a new SD card with a Raspbian image, there are a number of configuration steps that are needed to tune the configuration. This post is just to record the steps for my own future reference. It’s based on the latest (as of this writing) release, which is Raspbian Stretch.
-
- Edit the file /boot/config.txt to set (or uncomment) the following:
hdmi_safe=1
hdmi_force_hotplug=1
You can also adjust the pixel overscan settings for your monitor, if needed, and increase config_hdmi_boost if that helps. But those are the most important two (for me, at least). - Run the configuration utility
$ sudo raspi-config
and make the following adjustments:- 2 Network Options:
- N1 Hostname:set it to something useful and specific to the project
- N2 wifi: if you are connecting to the Internet via wifi, enter the SSID and password here.
- N3 Predictable Network Interface Names: DISABLE this (set it to NO) so that you get back simple interface names like “eth0” and “wlan0”. More details about this may be found at https://www.freedesktop.org/wiki/Software/systemd/PredictableNetworkInterfaceNames/
- 3 Boot Options:
- B1 Desktop/CLI: usually set this to Command Line Interface (CLI)
- B3 Splash Screen: turn this off, so you can see the boot process
- 4 Localization Options:
- I1 Change Local: change it to en_US
- I2 Timezone: change to your local timezone (eg. America/New York)
- I3 Keyboard: Select Generic 105-key PC and English (US). You can also set special keys here.
- 5 Interface Options:
- P2 SSH: enable it, so you can ssh into the pi and work on it even when it’s headless.
- P5 Serial: disable this, unless you actually have a serial port device to connect to it.
- P1 Camera: enable this if you intend to use the Raspberry Pi camera.
- 6 Advanced Options:
- A1 Expand Filesystem: expand the filesystem to use the entire SD card. (this might now be done automatically at first boot).
- 2 Network Options:
- Install emacs (so I can edit things easily, though nano is not bad):
$ sudo apt-get install emacs
I also like tcsh, so I’ll install that now too. - Update and Upgrade:
$ sudo apt-get update
(Remember, this just updates the package database, which “resynchronize the package index files from their sources”1)
$ sudo apt-get upgrade
- Edit the file /boot/config.txt to set (or uncomment) the following:
(This actually installs the newest versions of all the packages, at least for the Debian version you are using. It does not upgrade to a newer version of Debian.)
- Set new passwords:
$ sudo passwd root
to set a new root password
$ passwd
to set a new password for user “pi”
References
- apt-get man page ↩