How to update a Raspberry Pi
Keep your Raspberry Pi fast and secure with three Terminal commands: check for updates, install them, then restart.
- Raspberry Pi
- Beginner
- 10 to 30 minutes
- 4 steps
Before you start
- A Raspberry Pi that has started up and shows the desktop
- An internet connection (Wi-Fi or Ethernet)
- A keyboard, so you can type three short commands
Open the Terminal
About 1 minute
Open the app where you type commands.
- Click the Terminal icon in the menu bar at the top of the screen. It looks like a black window with a prompt.
- Can't see it? Open the Raspberry Pi menu in the top-left corner, choose Accessories, then Terminal.
You should see
A window opens with a blinking cursor after your username and the name of your Pi.
Check for updates
About 2 minutes
Ask your Pi which software has newer versions available.
- Type this command into the Terminal, then press Enter.
sudo apt updateThis only checks. Nothing is installed yet.
You should see
Lines of text scroll by, then it finishes and tells you how many packages can be upgraded, or that all packages are up to date.
It didn't work
It says it could not resolve a host, or a download failed.
Your Pi isn't online. Check the Wi-Fi icon at the top right or your Ethernet cable, then run the command again.
It says it could not get a lock, or another process is using it.
Your Pi is already installing updates in the background. Wait a few minutes, then run the command again.
Install the updates
About 15 minutes
Download and install everything that's waiting.
- When the first command has finished, type this command and press Enter.
- Stay near the screen. It can take a while, and now and then it asks you a question. If you miss one, your Pi stops and waits for you, which makes the whole update take longer.
- If it asks whether you want to continue, type Y and press Enter.
sudo apt full-upgradeSafe to run, but it can be slow. The time depends on how many updates are waiting.
You should see
The text stops scrolling and you see your username and prompt again, ready for a new command.
It didn't work
The screen has stopped moving.
Scroll to the bottom of the Terminal. Your Pi may be waiting for an answer. Type Y or the option it shows, then press Enter.
Restart your Pi
About 2 minutes
Restart so the updates take effect.
- Save anything you have open in other windows.
- Type this command and press Enter. You can also restart from the Raspberry Pi menu: choose Shutdown, then Reboot.
sudo rebootYou should see
The screen goes dark for a moment and your Pi starts up again with the updates in place.
What to do next
- Set up your Raspberry PiNew Pi, or starting over? Go from the box to your first boot.
- Find your first projectAn up-to-date Pi is ready to build on. Pick a small project.
- Check your pinoutWiring something up? See which pin does what on your board.
Stuck? Contact Vilros Support with your Pi model and what you see on screen.