Raspberry Pi — SBC
First Boot & System Updates
After successfully connecting to your Pi via SSH, run these essential setup steps to update the system and configure it for development.
Step 1 — Update the Package List and Upgrade
Always run updates immediately after a fresh OS install:
sudo apt update
sudo apt upgrade -y
This may take 5–10 minutes on first run as it downloads all pending security patches and package updates.
Step 2 — Install Essential Development Tools
sudo apt install -y \
git \
python3 \
python3-pip \
python3-venv \
python3-dev \
build-essential \
cmake \
ninja-build \
curl \
wget \
vim \
htop \
tree \
unzip \
i2c-tools \
pigpio
Step 3 — Configure Hostname
If you want to change your Pi's hostname:
sudo hostnamectl set-hostname analog-pi
Edit the hosts file to match:
sudo nano /etc/hosts
# Change: 127.0.1.1 raspberrypi
# To: 127.0.1.1 analog-pi
Step 4 — Enable Important Interfaces
Use the raspi-config tool to enable I2C, SPI, and the camera:
sudo raspi-config
Navigate to:
- Interface Options → I2C → Enable
- Interface Options → SPI → Enable
- Interface Options → Camera → Enable (Pi 4 with Camera Module)
- Interface Options → SSH (verify it's enabled)
Select Finish and Reboot when prompted.
After reboot, reconnect via SSH and verify I2C is enabled:
ls /dev/i2c-*
# Expected: /dev/i2c-1
Step 5 — Set Timezone and Locale
# Set timezone (example: Asia/Kolkata for IST)
sudo timedatectl set-timezone Asia/Kolkata
# Verify
timedatectl
Step 6 — Configure Python Environment
On Raspberry Pi OS (Bookworm+), system Python is managed and pip install without a virtual environment may be blocked. Create a virtual environment for your projects:
# Create a project virtual environment
python3 -m venv ~/workshop_env
# Activate it
source ~/workshop_env/bin/activate
# Now install packages freely
pip install numpy opencv-python-headless pillow requests
To activate this environment automatically when you log in:
echo "source ~/workshop_env/bin/activate" >> ~/.bashrc
Step 7 — Test GPIO Access
# Install the RPi.GPIO library
pip install RPi.GPIO
# Quick GPIO test (Python)
python3 - << 'EOF'
import RPi.GPIO as GPIO
GPIO.setmode(GPIO.BCM)
GPIO.setup(18, GPIO.OUT)
GPIO.output(18, GPIO.HIGH)
import time
time.sleep(1)
GPIO.output(18, GPIO.LOW)
GPIO.cleanup()
print("GPIO test passed!")
EOF
Step 8 — Set Up Automatic Security Updates (Optional)
sudo apt install -y unattended-upgrades
sudo dpkg-reconfigure --priority=low unattended-upgrades
Essential Commands Reference
Once your Pi is set up, here are the commands you'll use most often:
# System
sudo reboot # Reboot the Pi
sudo shutdown -h now # Safely power off
df -h # Check disk space
free -h # Check memory usage
vcgencmd measure_temp # CPU temperature (Pi 4/5)
htop # Live system resource monitor
# Network
ip addr # Show IP addresses
nmcli device wifi list # List available Wi-Fi networks
nmcli device wifi connect "SSID" password "PASSWORD" # Connect to Wi-Fi
# GPIO & Peripherals
i2cdetect -y 1 # Scan I2C bus for connected devices
ls /dev/ttyAMA* /dev/ttyUSB* # List serial ports
raspi-config # System configuration tool
# Package management
sudo apt update # Update package list
sudo apt upgrade # Upgrade installed packages
sudo apt install <package> # Install a package
sudo apt remove <package> # Remove a package
Connecting via VS Code (Recommended for Workshops)
For a full IDE experience on your Pi:
- Install the Remote - SSH extension in VS Code
- Press
F1→Remote-SSH: Connect to Host - Enter
analog@analog-pi.local - Open the
/home/analog/folder in VS Code - Use the integrated terminal to run commands on the Pi
🎉 Your Raspberry Pi is Ready!
You now have a fully updated, configured Raspberry Pi ready for:
- Python development
- GPIO and sensor experiments
- Edge AI inference
- Computer vision with OpenCV
- Linux-based IoT projects

