How do I update software and firmware?
I understand that the software on the Raspberry Pi is divided into three sections: the closed-source GPU firmware, the patched ARM Linux kernel and the user space software.
Is the GPU firmware on the chip or SD card? Is there an easy way to update everything (firmware, kernel, modules)?
EDIT: Since this post was written, the advice has changed.
rpi-updateshould not be used unless specifically advised to by an RPi engineer / beta-testing. It is an unstable version of the firmware. It used to be necessary for updates but isn't anymore. See this answer on another question.
What is the GPU firmware and kernel?
The kernel is responsible for managing the resources of the Raspberry Pi and runs on the central processing unit (CPU). It allows tasks to run on the CPU. The GPU firmware, on the other hand, manages the graphical processing unit (GPU). The two separate units are on the same chip and share memory, which is segregated at boot time according to hard-coded
start.elffiles. In order to use the Raspberry Pi, both sets of files must be in the correct locations on the SD card.
You can buy preloaded SD cards from the retail partners of the Foundation.
Alternatively, the Foundation regularly release new SD cards images at http://www.raspberrypi.org/downloads. You must use Unix's
Win32DiskImagerto load this on an existing SD card.
It's not possible to compile your own GPU firmware image, because it is closed source, so we rely on the Foundation and Broadcom to supply this. On the other hand, you can compile your own kernel image from source. Cross-compilation is the subject of other questions, such as How do I cross-compile the kernel on a Ubuntu host?
Updating the GPU firmware - Debian/Raspbian
You can update the firmware using
rpi-updateby Hexxeh. On Raspbian, you can install it by running
sudo apt-get install rpi-update
To update the software, run
Updating userspace and kernel Software - Debian/Raspbian
The userspace software must be maintained. It's pretty easy; just run
sudo apt-get upgrade
If there are any errors, you can try updating the database first by running
sudo apt-get update
If you don't understand an error, then it's probably best you ask here or try googling.
Updating software - Arch Linux
The software must be maintained. The advantage of Arch Linux over Debian here is that Arch Linux manages the Raspberry Pi's firmware within the package management system. To update, just run
sudo pacman -Syu
If there are any errors and you don't understand it, then it's probably best you ask here or try googling.
A user has also created a tool called rpi-updater which will update the firmware, kernel and modules
Have a look at Hexxeh's RPi-Updater. It's specifically built for upgrading the firmware and kernel.
If you're running Arch Linux then the updates will be a part of your regular
pacman -Syuas they exist in the official RPi repositories.
Be cautious when using rpi-update (it's for bleeding edge kernels) - Raspbian updates will also upgrade the kernel: http://raspberrypi.stackexchange.com/questions/4355/do-i-still-need-rpi-update-if-i-am-using-the-latest-version-of-raspbian
To update your system to latest versions of the userland software you need to run the update before the upgrade - the update actually downloads the new package listings so that upgrade can go get them and install them (as explained in Debian Linux documentation):
sudo apt-get update sudo apt-get upgrade
Furthermore you may need to run a dist-upgrade to perform larger upgrades:
sudo apt-get dist-upgrade
If you want to automate these procedures it can be done by configuring apt's Periodic options. The Raspberry Pi comes with apt installed (it provides the apt-get commands, etc.), and as part of that package an automated script is installed (in /etc/cron.daily/apt) for doing automated updates on a daily basis (using the cron daemon). These may be controlled by creating (as root) a file /etc/apt/apt.conf.d/10periodic putting the following into it:
APT::Periodic::Update-Package-Lists "1"; APT::Periodic::Download-Upgradeable-Packages "0"; APT::Periodic::AutocleanInterval "0"; APT::Periodic::Unattended-Upgrade "0";
This configuration will just run update every day for you so when you run
sudo apt-get upgradeyou'll install the latest packages (without having to first run apt-get update).
To configure apt to automatically upgrade packages as well - firstly you'll need to install a new package to make the unattended upgrades work:
sudo apt-get install unattended-upgrades
Then you change the following option to "1" in /etc/apt/apt.conf.d/10periodic to enable automated upgrades:
For more details see the comments inside the /etc/cron.daily/apt and then put the relevant options into the /etc/apt/apt.conf.d/10periodic file.
This is the correct answer to update RPI in beginning of 2017, rpi-update is not needed any more
is the filename not '02periodic' (in /etc/apt/apt.conf.d) - at least that is what the 'apt' file says in cron.daily - "# Create /etc/apt/apt.conf.d/02periodic file to set your preference."