Raspi – Setting up Raspberry Pi OS

Installation of Raspberry Pi OS

Download and install the Raspberry Pi Imager tool on your PC.

Insert an SD card (with a size of 32 GB or more) into the card reader of your PC. Run Raspberry Pi Imager, select the operating system (e.g. Raspberry Pi OS (other) -> Raspberry Pi OS (64-bit)), select the storage (your SD card) and start the write operation. For more details see https://www.raspberrypi.com/documentation/computers/getting-started.html.

Connect display, keyboard and optionally ethernet to your Raspberry Pi and finally connect the power supply. The installation starts automatically. Please wait until you see the ‘Welcome to the Raspberry Pi Desktop!‘ message. Click ‘Next’, select country, language and timezone, optionally select the option ‘Use English language’ (for UI) and click ‘Next’. Enter the credentials for your (privileged) user account to be created, A standard user often used (also in other articles here) is username pi with password raspberry, but you may use any username / password. I strongly recommend not to use this password!

During the following installation steps you may adjust your screen if necessary, connect to your WLAN and finally check for updates.

After a reboot Raspberry Pi OS is started and you are logged in to the user account you have created during the installation and the desktop is displayed.

If you have problems with your keyboard layout, you have to configure it: Click the Applications menu (top left), select Preferences -> Keyboard and Mose -> Keyboard -> Keyboard Layout -> select your layout.

Shutdown

Important: Shutdown the Raspberry Pi before you switch it off (before you remove the power supply) using the Application Menu (top left) -> Logout -> Shutdown or enter the following command in a terminal window:

ssh shutdown -h now

… and wait as long as the LED flashes (a few seconds).

Create additional user accounts

Create user without special privileges:
sudo adduser {username}

Create user with all privileges:
sudo adduser {username}
sudo usermod -a -G adm,dialout,cdrom,sudo,audio,video,plugdev,games,users,input,render,netdev,spi,i2c,gpio,lpadmin {username}

The groups define the privileges of a user. If you want to see the groups of a user: groups {username}

Modify sudoers configuration used by the sudo command
The sudoers configurations are located in /etc/sudoers.d/
E.g. copy an existing configuration to be used for another user:
sudo cp /etc/sudoers.d/010_pi-nopasswd /etc/sudoers.d/110_peter-nopasswd
sudo nano /etc/sudoers.d/110_peter-nopasswd
-> in the editor: change username from pi to peter

Change hostname

Applications menu -> Preferences -> Raspberry Pi Configuration -> System -> Hostname

Enable SSH and VNC access

Applications menu -> Preferences -> Raspberry Pi Configuration -> Interfaces -> switch on the options SSH and VNC.

A separate article describes how to to set up SSH access from PC to Raspberry Pi: Raspi – Setting up remote access with SSH

Configuration

The two most important configuration utilities:

  • Applications menu -> Preferences -> Raspberry Pi Configuration
  • In a terminal: sudo raspi-config

Change colors of ls command

cd ~
dircolors -b >> .bashrc
nano .bashrc

source .bashrc
E.g. change :di=01;34: to :di=01;33: to get yellow directoy names. For more information: https://linuxhint.com/ls_colors_bash/ or https://man7.org/linux/man-pages/man5/dir_colors.5.html.

Leave a Reply