Search icon CANCEL
Arrow left icon
Explore Products
Best Sellers
New Releases
Books
Videos
Audiobooks
Learning Hub
Conferences
Free Learning
Arrow right icon
Arrow up icon
GO TO TOP
Raspberry Pi cookbook for Python programmers

You're reading from   Raspberry Pi cookbook for Python programmers The Raspberry Pi Cookbook has over 50 tailor-made recipes for programmers to get the most out of Raspberry Pi using Python to unleash its huge potential.

Arrow left icon
Product type Paperback
Published in Apr 2014
Publisher
ISBN-13 9781849696623
Length 402 pages
Edition 1st Edition
Languages
Arrow right icon
Toc

Table of Contents (18) Chapters Close

Raspberry Pi Cookbook for Python Programmers
Credits
About the Author
About the Reviewers
www.PacktPub.com
Preface
1. Getting Started with a Raspberry Pi Computer FREE CHAPTER 2. Starting with Python Strings, Files, and Menus 3. Using Python for Automation and Productivity 4. Creating Games and Graphics 5. Creating 3D Graphics 6. Using Python to Drive Hardware 7. Sense and Display Real-world Data 8. Creating Projects with the Raspberry Pi Camera Module 9. Building Robots 10. Interfacing with Technology Hardware and Software List Index

Keeping the Raspberry Pi up to date


The Linux image used by the Raspberry Pi is often updated to include enhancements, fixes, and improvements to the system, as well as adding support for new hardware, or changes made to the latest board. Many of the packages that you install, can be updated too.

This is particularly important if you plan on using the same system image on another Raspberry Pi board (particularly, a newer one) as older images will lack support for any wiring changes or alternative RAM chips. New firmware should work on older Raspberry Pi boards, but older firmware may not be compatible with the latest hardware.

Fortunately, you need not reflash your SD card every time there is a new release, since you can update it instead.

Getting ready

You will need to be connected to the Internet in order to update your system. It is always advisable to make a backup of your image first (and at a minimum, take a copy of your important files).

You can check your current version of firmware with the uname -a command as follows:

Linux raspberrypi 3.1.9+ #168 PREEMPT Sat Jul 14 18:56:31 BST 2012 armv6l GNU/Linux

The GPU firmware can be checked using the /opt/vc/bin/vcgencmd version command as follows:

   Jul 14 2012 13:14:40
Copyright (c) 2012 Broadcom
version 325444 (release)

This is important if you are using an older version of firmware (pre-November 2012) on a newer board since the Model B board was only 254 MB RAM. Upgrading allows the firmware to make use of the extra memory if available.

The free -h command will detail the RAM available to the main processor (the total RAM is split between the GPU and ARM cores) and will give the following output:

             total       used       free     shared    buffers     cached
Mem:          183M       125M        58M         0B       9.1M        96M
-/+ buffers/cache:        19M       164M
Swap:          99M         0B        99M

You can then recheck the preceding output following a reboot to confirm if they have been updated (although they may have already been the latest).

How to do it…

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

If you just want to obtain an upgrade of your current packages, upgrade will bring them all up to date:

sudo apt-get upgrade

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 the firmware used at boot and startup (bootcode.bin and start.elf).

You have been reading a chapter from
Raspberry Pi cookbook for Python programmers
Published in: Apr 2014
Publisher:
ISBN-13: 9781849696623
Register for a free Packt account to unlock a world of extra content!
A free Packt account unlocks extra newsletters, articles, discounted offers, and much more. Start advancing your knowledge today.
Unlock this book and the full library FREE for 7 days
Get unlimited access to 7000+ expert-authored eBooks and videos courses covering every tech area you can think of
Renews at $19.99/month. Cancel anytime