Raspberry Pi Intro

Quick And Easy Way To Install Raspberry Pi OS #raspiSeries — Episode 0

J3
Jungletronics
7 min readAug 10, 2024

--

Hi there! Let’s get started with just a Raspberry Pi 4 board and a power connector.

In this episode we will:


Flash the Raspberry Pi OS
onto the SD card
and access it via SSH.

No display or Micro HDMI needed.

Hardware:

Raspberry Pi 4

How to Set Up a Headless System Without Ever Connecting a Monitor!
My System:

OS: Ubuntu 24.04 LTS
Processor: Intel® Core™ i7–9750H × 12 — 8.0 GiB RAMLet's get started!

Let’s get started!

0# step— Buy an SD card like this one:

SDCS2/64GB

microSD Memory Card Canvas Select Plus

Read: 100MB/s — Class 10 with SD Adapter

link
I just bought this Kingston SD card. I tried using another one, but it failed. It seems that the Raspberry Pi doesn’t support larger SD cards. I made several attempts to flash a 1TB SanDisk, but it didn’t work :/
Using UDisks 2.10.1, explore the original partition of the disk. It comes pre-formatted with an exFAT filesystem from the factory.

1# step — Install Raspberry Pi OS using Raspberry Pi Imager; To install on Raspberry Pi OS in a Terminal window, type:

sudo apt install rpi-imager

2# step —Configure the following settings: Raspberry Pi 4, Raspberry Pi OS (64-bit), and select your SD card. Then click Next:

Raspberry Pi Imager in action — it’s amazing! Four years ago, it was a nightmare. Check out my old tutorial for a comparison…
Note: I have reset the username to pi and the password to pi. I’ve also entered my Wi-Fi SSID and password, as well as my location details. Please adjust these settings according to your own setup.
Here, I simply enable SSH
…and in the final window, I accept the default values. Hit “Save”.
Click “Yes” to customize your SSH settings.
It’s just a warning that the disk will be erased. Click ‘Yes’ to proceed.
It takes some time, roughly 20 to 30 minutes, depending on your bandwidth…
Verification in progress. Thank you for your patience!
Click “Continue” and then transfer the disk to your Raspberry Pi 4.
Use Angry IP Scanner to find the IP address of your Raspberry Pi. However, this step is optional because you can also access your Raspberry Pi using raspberrypi.local. This is the default hostname of the Raspberry Pi, and the .local domain is used to resolve it on a local network through mDNS (Multicast DNS).

3# step — Open your Linux terminal and type:

ssh pi@raspberrypi.local
j3@j3-LAPTOP:~$ ssh pi@raspberrypi.local
@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@
@ WARNING: REMOTE HOST IDENTIFICATION HAS CHANGED! @
@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@
IT IS POSSIBLE THAT SOMEONE IS DOING SOMETHING NASTY!
Someone could be eavesdropping on you right now (man-in-the-middle attack)!
It is also possible that a host key has just been changed.
The fingerprint for the ED25519 key sent by the remote host is
SHA256:9ipBVAynVWVaGNQkO90MnCZlhIiMsqq9Mw8eVZ0/BWY.
Please contact your system administrator.
Add correct host key in /home/j3/.ssh/known_hosts to get rid of this message.
Offending ECDSA key in /home/j3/.ssh/known_hosts:3
remove with:
ssh-keygen -f '/home/j3/.ssh/known_hosts' -R 'raspberrypi.local'
Host key for raspberrypi.local has changed and you have requested strict checking.
Host key verification failed.

j3@j3-LAPTOP:~$ ssh-keygen -f '/home/j3/.ssh/known_hosts' -R 'raspberrypi.local'
# Host raspberrypi.local found: line 2
# Host raspberrypi.local found: line 3
/home/j3/.ssh/known_hosts updated.
Original contents retained as /home/j3/.ssh/known_hosts.old

j3@j3-LAPTOP:~$ ssh pi@raspberrypi.local
The authenticity of host 'raspberrypi.local (192.168.0.114)' can't be established.
ED25519 key fingerprint is SHA256:9ipBVAynVWVaGNQkO90MnCZlhIiMsqq9Mw8eVZ0/BWY.
This key is not known by any other names.
Are you sure you want to continue connecting (yes/no/[fingerprint])? yes
Warning: Permanently added 'raspberrypi.local' (ED25519) to the list of known hosts.
pi@raspberrypi.local's password:
Linux raspberrypi 6.6.31+rpt-rpi-v8 #1 SMP PREEMPT Debian 1:6.6.31-1+rpt1 (2024-05-29) aarch64

The programs included with the Debian GNU/Linux system are free software;
the exact distribution terms for each program are described in the
individual files in /usr/share/doc/*/copyright.

Debian GNU/Linux comes with ABSOLUTELY NO WARRANTY, to the extent
permitted by applicable law.
Last login: Wed Jul 3 20:17:36 2024

pi@raspberrypi:~ $

This issue occurred because I already had an entry for the Raspberry Pi in my known_hosts file. If you haven’t accessed it before, you will be prompted with the message, Are you sure you want to continue connecting (yes/no/[fingerprint])? Simply type “yes” to proceed.

4# step — To update and configure your Raspberry Pi, type:

sudo raspi-config
Use the arrow keys and TAB to select “Update.”
To make sure your entire SD card is available, go to “Expand Filesystem”.
This will enable VNC access.
Hit “Yes” to enable VNC.
The final screen: VNC is enabled!
Set your Locales…
Portuguese as language option…
I am from Brazil.
Reboot!

Here is all my output for your reference:

pi@raspberrypi:~ $ sudo raspi-config
Hit:1 http://deb.debian.org/debian bookworm InRelease
Get:2 http://deb.debian.org/debian-security bookworm-security InRelease [48.0 kB]
Get:3 http://deb.debian.org/debian bookworm-updates InRelease [55.4 kB]
Get:4 http://deb.debian.org/debian-security bookworm-security/main arm64 Packages [167 kB]
Get:5 http://archive.raspberrypi.com/debian bookworm InRelease [39.0 kB]
Get:6 http://deb.debian.org/debian-security bookworm-security/main armhf Packages [163 kB]
Get:7 http://deb.debian.org/debian-security bookworm-security/main Translation-en [103 kB]
Get:8 http://archive.raspberrypi.com/debian bookworm/main arm64 Packages [440 kB]
Get:9 http://archive.raspberrypi.com/debian bookworm/main armhf Packages [443 kB]
Fetched 1,355 kB in 4s (316 kB/s)
Reading package lists... Done
Reading package lists... Done
Building dependency tree... Done
Reading state information... Done
^[[3~The following packages will be upgraded:
raspi-config
1 upgraded, 0 newly installed, 0 to remove and 46 not upgraded.
Need to get 34.8 kB of archives.
After this operation, 2,048 B of additional disk space will be used.
Get:1 http://archive.raspberrypi.com/debian bookworm/main arm64 raspi-config all 20240708 [34.8 kB]
Fetched 34.8 kB in 1s (37.8 kB/s)
Reading changelogs... Done
(Reading database ... 128147 files and directories currently installed.)
Preparing to unpack .../raspi-config_20240708_all.deb ...
Unpacking raspi-config (20240708) over (20240625) ...
Setting up raspi-config (20240708) ...
Sleeping 5 seconds before reloading raspi-config

Welcome to fdisk (util-linux 2.38.1).
Changes will remain in memory only, until you decide to write them.
Be careful before using the write command.

This disk is currently in use - repartitioning is probably a bad idea.
It's recommended to umount all file systems, and swapoff all swap
partitions on this disk.


Command (m for help):
Disk /dev/mmcblk0: 58.27 GiB, 62562238464 bytes, 122191872 sectors
Units: sectors of 1 * 512 = 512 bytes
Sector size (logical/physical): 512 bytes / 512 bytes
I/O size (minimum/optimal): 512 bytes / 512 bytes
Disklabel type: dos
Disk identifier: 0xc4870184

Device Boot Start End Sectors Size Id Type
/dev/mmcblk0p1 8192 1056767 1048576 512M c W95 FAT32 (LBA)
/dev/mmcblk0p2 1056768 122191871 121135104 57.8G 83 Linux

Command (m for help): Partition number (1,2, default 2):
Partition 2 has been deleted.

Command (m for help): Partition type
p primary (1 primary, 0 extended, 3 free)
e extended (container for logical partitions)
Select (default p): Partition number (2-4, default 2): First sector (2048-122191871, default 2048): Last sector, +/-sectors or +/-size{K,M,G,T,P} (1056768-122191871, default 122191871):
Created a new partition 2 of type 'Linux' and of size 57.8 GiB.
Partition #2 contains a ext4 signature.

Command (m for help):
Disk /dev/mmcblk0: 58.27 GiB, 62562238464 bytes, 122191872 sectors
Units: sectors of 1 * 512 = 512 bytes
Sector size (logical/physical): 512 bytes / 512 bytes
I/O size (minimum/optimal): 512 bytes / 512 bytes
Disklabel type: dos
Disk identifier: 0xc4870184

Device Boot Start End Sectors Size Id Type
/dev/mmcblk0p1 8192 1056767 1048576 512M c W95 FAT32 (LBA)
/dev/mmcblk0p2 1056768 122191871 121135104 57.8G 83 Linux

Command (m for help): The partition table has been altered.
Syncing disks.

Created symlink /etc/systemd/system/multi-user.target.wants/wayvnc.service → /lib/systemd/system/wayvnc.service.
Generating locales (this might take a while)...
en_GB.UTF-8... done
pt_BR.UTF-8... done
Generation complete.

Current default time zone: 'America/Porto_Velho'
Local time is now: Sat Aug 10 16:10:21 -04 2024.
Universal Time is now: Sat Aug 10 20:10:21 UTC 2024.


Broadcast message from root@raspberrypi on pts/1 (Sat 2024-08-10 16:11:13 -04):

The system will reboot now!

pi@raspberrypi:~ $ Connection to raspberrypi.local closed by remote host.
Connection to raspberrypi.local closed.
j3@j3-LAPTOP:~$

Rerun the scanner to confirm Raspberry Pi get an ip:

Rerun the scanner to verify that the Raspberry Pi has received an IP address.

5 # step — Using RealVNC; On Ubuntu Terminal, type:

sudo apt-get update
sudo apt-get install realvnc-vnc-server
Now launch RealVNC and connect using your IP address.
Enter pi and pi
And there you have it! 🥰

6 # step — Some Desktop configuration:

Update the system again.
Updated!
Configure Appearance: Dark Mode 👌
I use the bar at the bottom. What about you?

That’s all for now, folks!

In the next episode, we’ll configure the Pi camera.

See you soon!

Bye!

Credits & References

Raspberry Pi OS by raspberrypi.com

Related Posts

Raspberry PI

0#Episode — #raspiSeries — Raspberry Pi Intro — Quick And Easy Way To Install Raspberry Pi OS

1#Episode — #raspiSeries — Raspberry Pi Camera Module — How To Connect the Rpicam, Take Pictures, Record Video, and Apply image effects

2#Episode — #raspiSeries — Raspberry Pi Camera Project — How to Build a Residential Intrusion Detection System

3#Episode — #raspiSeries — Raspberry Pi Camera Project — How to Build a Residential Intrusion Detection System

--

--

Jungletronics
Jungletronics

Published in Jungletronics

Explore our insights on Django, Python, Rails, Ruby, and more. We share code, hacks, and academic notes for developers and tech enthusiasts. Happy reading!

J3
J3

Written by J3

😎 Gilberto Oliveira Jr | 🖥️ Computer Engineer | 🐍 Python | 🧩 C | 💎 Rails | 🤖 AI & IoT | ✍️