On a Pi you add programs with apt, from a software source on the internet. You update the lists first, then install. sudo runs one command as the administrator, and the system records who used it.
Your phone has an app store. What does a Pi have?
An operating system keeps programs, files and hardware apart, and apt is how you add programs. It fetches them from a software source (a repository) over the network, so lessons about it need the internet unless the programs are already on a USB stick. Offline, your teacher can set up a local source.
How this lesson works: Predict, Try, Investigate, Modify, Practise, Make
Predict: Read the problem and decide what you think before you try anything. A wrong guess is fine: it shows you what to look for.
Try: Try it on the board and compare the result with your prediction.
Investigate: Work out why it happens, one step at a time.
Modify: Change the problem on purpose and see what happens.
Practise: A few on your own, to check you have it.
Make: Make your own problem using what you have learned. Expect a few tries; that is normal.
Make your prediction first. Help opens once you've locked it in.
PredictRead the problem and decide what you think before you try anything. A wrong guess is fine: it shows you what to look for.
A fresh Pi
TryTry it on the board and compare the result with your prediction.
Try: install tree
Was your prediction right?
Try it yourselfYour edits are saved in this browser.
Get the tree program onto the Pi: update the lists, then install it. Then run tree.
Use the board. This ticks when you get there.
InvestigateWork out why it happens, one step at a time.
Worked example: Installing, step by step
Worked exampleBefore each step, say what you think comes next.
sudo apt updatedownload the list of what is available. Nothing is installed yet.
sudo apt install treefetch the program and set it up.
sudo apt upgradereplace installed programs with newer versions.
sudo apt remove treetake it off again.
Now try it yourself.
Sam wants to avoid typing sudo. Click the line where it first goes wrong.
ModifyChange the problem on purpose and see what happens.
Vary: change one thing
Try it yourselfYour edits are saved in this browser.
Install cowsay (remember the lists).
Use the board. This ticks when you get there.
tree is installed. Remove it.
Use the board. This ticks when you get there.
The network is down. Try sudo apt update. What happens?
Use the board. This ticks when you get there.
PractiseA few on your own, to check you have it.
Practise
MakeMake your own problem using what you have learned. Expect a few tries; that is normal.
Set up a new Pi
Then: on a real Pi, run sudo apt update, then apt list --upgradable to see what is waiting.
Try it yourselfYour edits are saved in this browser.
On a Pi you add programs with apt, from a software source on the internet. You update the lists first, then install. sudo runs one command as the administrator, and the system records who used it. About 40 minutes.
I can update the package lists, then install a program.
I can say what sudo does and why a normal user needs it.
I can explain what happens when there is no internet.
Before class
Try the boards yourself.
The one idea: the operating system keeps programs apart from users, so changing the system needs an administrator, and apt fetches programs from a software source.
Simplification: the pretend software source has seven packages (samba, jellyfin, ufw, tree, cowsay, unattended-upgrades and vim); real ones have tens of thousands. Pi OS Lite already has nano, openssh-server and cron.
Offline: the course works without the internet on the pretend Pi. On a real Pi with no internet, plan for it in advance: download the .deb packages and their dependencies on another computer and install with sudo apt install ./file.deb; or run a local mirror (for example apt-cacher-ng on one Pi in the room); or use the Pi's own power: with no network, sudo apt update fails by design. Jellyfin is not in Raspberry Pi OS's own list: a real install adds Jellyfin's repository first (lesson 6 says so). Say this before students try it for real.
With internet: automatic security updates (unattended-upgrades) belong in the last lessons.
Real Pi (optional, any time): the pretend Pi is the same for every student, so nothing here needs hardware. If you have Pis, any number per group works, Pi 4 or Pi 5. A Pi 5 needs a 27 W USB-C supply (a 15 W phone charger makes it complain and limit USB power). Students can sit at a Pi with a screen and keyboard, or reach it by ssh from a laptop once it is on the network. Either start works for every lesson after the first: choose a ready-made image (you set the hostname, the user and ssh once, then clone the card) or have students flash their own with Raspberry Pi Imager (OS: Raspberry Pi OS Lite 64-bit; in the settings set a hostname, a user and password, ssh on, and Wi-Fi if needed). Both reach lesson 2 in the same state. To start again: reflash the card, or write a short reset script (remove added users, sudo apt remove, restore saved config files) and run it.