How to do it...

  1. Before running any upgrades or installing any packages, it is worth ensuring you have the latest list of packages in the repository. The update command gets the latest list of available software and versions:
sudo apt-get update  
  1. If you just want to obtain an upgrade of your current packages, upgrade will bring them all up to date:
sudo apt-get upgrade
  1. To ensure that you are running the latest release of Raspbian, you can run dist-upgrade (be warned: this can take an hour or so depending on the amount that needs to be upgraded). This will perform all the updates that upgrade will perform but will also remove redundant packages and clean up:
sudo apt-get dist-upgrade  

Both methods will upgrade the software, including ...

Get Raspberry Pi 3 Cookbook for Python Programmers - Third Edition now with the O’Reilly learning platform.

O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.