CHAPTER
7

Selecting an Operating System

In This Chapter

One of the best things about working with the Raspberry Pi is that you can pick your operating system. Because all the operating systems available for the Raspberry Pi are based on Linux, you have a wide variety of options to choose from, and each has advantages and disadvantages.

It’s not just about picking an operating system to do regular computer work with either. Custom operating systems exist to turn your Raspberry Pi into a media center, a learn-to-code machine, and so much more.

In this chapter, we explore a few of the most popular operating systems available for the Raspberry Pi, and I explain a bit more about why the Raspberry Pi uses Linux instead of any other operating system.

An Introduction to Linux

Linux (linux.com) is a free and open-source operating system originally released in 1991 by software engineer Linus Torvalds. Because it’s open source, it’s available in many different variations and can work on everything from mobile phones to personal computers, all without any licensing. For example, the smartphone operating system Android is based on Linux.

Linux is meant to be a free, fully customizable alternative to the Windows and OS X operating systems. It works essentially the same way as these operating systems, although it certainly has its own set of quirks. It isn’t as polished or fancy as the newest version of Windows, but it does what it needs to do.

Unlike in Windows or OS X, a lot of the work you do in Linux takes place at the command line, where you type in specific commands instead of using a mouse to click buttons or menus. Subsequently, it’s a bit harder to use than something like Windows.

DEFINITION

The command line is a way to interact with a computer program using typed commands as text instead of a mouse. Instead of clicking on something with your mouse, you tell your computer to perform an action using a simple string of text. Working with the command line might sound intimidating, but it’s actually very easy once you get the hang of it. (I talk more about the command line in Chapter 9.)

Linux is based on UNIX, which is the same operating system OS X was built on. These days, Linux is primarily used for servers, but plenty of people use it as the operating system for their personal computing needs as well.

Linux comes in many variations, called distributions. Raspbian (Raspbian.org), Mint (linuxmint.com), Ubuntu (ubuntu.com), Debian (debian.org), and Fedora (getfedora.org) are some of the more popular versions. Each distribution looks and handles things a little differently.

Anyone can make a distribution of Linux, so it’s also popular for home theater PCs. For example, OpenELEC (openelec.tv) is an operating system built on Linux that’s meant to turn your computer (or Raspberry Pi) into a media center.

PI POINTER

Remember, with the Raspberry Pi, you install your operating system on an SD card. This means you can download as many operating systems on different SD cards as you like and swap among them.

Why the Raspberry Pi Uses Linux

It’s natural to assume that the Raspberry Pi uses Linux as its operating system because it’s free, but that’s not the only reason. Free means you don’t have to pay any licensing fees to use it, like you would with Windows. It also means anyone in the world can use a Raspberry Pi without jumping through any hoops to get a license.

Because Linux is open source, you can make customized versions of Linux for the Raspberry Pi for your own unique projects. For example, the operating system arkOS (arkos.io) is just for email hosting, and Mozilla, the team behind the web browser Firefox, is making an operating system called Firefox OS (mozilla.org/en-US/firefox/os) that will work on the Raspberry Pi.

Besides Linux, other popular open-source software includes the web browser Chromium (chromium.org) and the office suite LibreOffice (libreoffice.org).

Open-Source Ideology

The Raspberry Pi itself is open source, as are most of the materials the Raspberry Pi Foundation releases for it. This means people are usually free to license, reuse, and remix the software or hardware any way they like. It also means the source code (or schematics) are available for everyone to see.

Typically, open source also means collaboration. Because everyone out there can see the source code, everyone can work on it together. In the case of the Raspberry Pi, this was an important factor in how the creators wanted the device to work.

The primary purpose of the Raspberry Pi is to teach children to code at a young age, so the designers needed an operating system that could do that. Linux is a perfect fit. Most of the software available on Linux is open source as well.

The Raspberry Pi Foundation wants to get kids tinkering with electronics, and the best way to do that is to give them open access to any software they want. Linux makes it easy to tinker with the core of the system, and that’s a great way to learn how it works.

Why Windows and OS X Don’t Work

Simply put, Windows and OS X won’t work on the Raspberry Pi because the device isn’t powerful enough to run any modern version of these operating systems.

It’s also because of the type of processor the Raspberry Pi has. It’s an ARM processor, and no versions of Windows support ARM. ARM is a completely different type of system architecture typically meant for smartphones.

Definition

An ARM processor is a type of processor architecture made to use fewer transistors than other processors. This means they’re usually cheaper, use less power, and don’t create as much heat. They’re often the choice for processors in smartphones, tablets, laptops, and set-top boxes. The Raspberry Pi uses an ARM processor to keep costs down and power consumption low.

Linux Distributions for the Raspberry Pi

The Raspberry Pi can work with many different Linux distributions, but in this book, we’ll stick to just the more popular ones. These include Raspbian, Arch Linux, and Debian, along with a few more specialized distributions. Each distribution can also have several variants, which usually just slightly alter the bundled software inside a distribution.

So many versions of Linux exist because each distribution is a little different, and typically one is better at a specific task than another is. Sometimes it’s just cosmetic, but for the most part, you can determine which version of Linux is best for you based on what you plan on doing with it.

Let’s take a look at some of the most popular options.

Raspbian

Raspbian (Raspbian.org) is the most popular version of Linux built for the Raspberry Pi. It was the first one available, and it remains the most actively developed version.

Raspbian is based on the popular Linux distribution Debian, but it’s optimized to work with the Raspberry Pi’s hardware. Raspbian is appealing because it includes a ton of software right from the start so you don’t need to go out and download stuff on your own. Pretty much everything you need to get started is included—a web browser, notepad, setup tools, and more. Whatever isn’t included can easily be downloaded from the Pi Store (store.raspberrypi.com).

What’s more, the settings for all the software included in Raspbian are adjusted to work with the Raspberry PI CPU. That means almost everything works smoothly on the Raspberry Pi and you don’t have to worry much about changing settings to get hardware working properly.

Raspbian isn’t actually affiliated with the Raspberry Pi Foundation in any way. It was created by, and continues to be developed by, a small team of developers who believe in the foundation’s goals. That said, the Raspberry Pi Foundation has its own distribution of Raspbian that’s packed with software the foundation recommends. You can download other variations of Raspbian, including a minimalist image, an image built specifically for education, and more from the Raspbian website (raspbian.org). (I show you how to install and use Raspbian in the next chapter.)

PI POINTER

The operating systems mentioned in this section aren’t the only options for your Raspberry Pi. Many variations on Linux exist–and even variations on those variations. For example, there are at least seven other versions of Raspbian out there. Anyone can make a Linux distribution, so be sure to always download from trusted sources.

Arch Linux

Arch Linux (archlinux.org) takes the opposite approach Raspbian takes. Instead of including as many pieces of software as possible, it includes as few. Arch Linux is a much more minimalist operating system.

Unlike Raspbian, Arch Linux features mostly command line tools instead of a graphical interface. Subsequently, Arch Linux tends to be the preferred operating system for more advanced users who don’t need the point-and-click simplicity of Raspbian. Arch Linux still has a graphical frontend, but you don’t rely on it nearly as much you would with something like Raspbian.

Arch Linux was originally released in 2002 and is currently developed by programmer/developer Aaron Griffin and a small team. The Raspberry Pi version, also known as Arch Linux ARM (named for the CPU), was developed by a small team of four developers. Arch Linux ARM (archlinuxarm.org) works on any computer running an ARM CPU.

Arch Linux ARM is targeted more toward experienced Linux users who are familiar with the system. It’s a small, unobtrusive operating system, tends to be a little faster than something like Raspbian, but is considerably harder to use. Arch Linux is a great operating system to use once you’re familiar with your Raspberry Pi, but skip it for something easier for your first few projects.

Debian

Debian (debian.org) is another of the more popular distributions of Linux and is used as the base of Raspbian. Because Debian is open source, the developers of Raspbian adapted Debian so it could be optimized to work on the Raspberry Pi.

Debian was originally released in 1993, with the first stable release in 1996. As one of the earliest Linux distributions, it remains the base for many other versions of Linux, and it’s still one of the most popular Linux distributions for personal computers.

Like Raspbian, the default installation of Debian includes free software that enables you to edit photos, play media files, and browse the web.

You can still install Debian on your Raspberry Pi, but it’s not well supported and will take a lot of work to get everything running smoothly. Instead, it’s typically recommended that you use Raspbian because it’s based on the Debian and is optimized to work well with the Raspberry Pi.

Raspbmc, XBian, and OpenELEC

Many Raspberry Pi users turn the device into a media center. Media centers allow you to play movies you own, stream content from sites online, play music, and even browse photos. If you’ve never used a media center before, think of it like a DIY version of Roku, Apple TV, or another similar set-top box. In the case of the Raspberry Pi, you provide the hardware and then download and install the software you want.

DEFINITION

Media center is really just a fancy phrase for a computer that hosts your media. You can set up a media center to stream content from an external hard drive, from another computer in your house, or from sources online. They’re basically a DIY set-top box you make yourself.

Several different media center distributions are available, but Raspbmc, XBian, and OpenELEC are the most widely used. All three are based on the Linux-based open-source media center software XBMC (kodi.tv). Popular for personal computers, XBMC was originally released in 2002 as a means to add media center functionality to the Xbox but has since grown into software that works on Windows, OS X, Android, iOS, Linux, and more. In the case of the Raspberry Pi, most media centers are their own distributions.

Which media center is best is really up to your preferences. They’re easy enough to install, it might be worth you checking out all three before you make your decision. Let’s look at each in a bit more detail to help you decide:

Raspbmc: Raspbmc (raspbmc.com) is the most complete of all three options. It’s built on XBMC, and everything works right out of the box so you don’t have to go search for extra stuff to install. Raspbmc runs as a full Linux build, so it’s a little slow to boot and takes up a big chunk of space on your SD card. That said, the fact that it includes everything on the SD card means you don’t really need to do much to set it up. Once you install Raspbmc onto your SD card, you can boot it up and start using all its features right away.

XBian: Whereas Raspbmc is packed full of features, XBian (xbian.org) prides itself on getting those features first. XBian is all about the cutting edge, and it constantly updates with new features, regardless of whether they’ve been tested for bugs. So although XBian is often feature-packed, it’s also usually a little wonky.

XBian is built on Raspbian, so it can do just about everything Raspbian can. XBian is also incredibly configurable. You can set it up with a ton of different software and extend its functionality with more features than Raspbmc. Even with the potential bugs, XBian is pretty easy to use and good for beginners who don’t like Raspbmc.

OpenELEC: Raspbmc and XBian strive to include a ton of features, but OpenELEC (openelec.tv) tries to include as few as possible. OpenElec is essentially Raspbmc stripped down to just the essentials. Therefore, it’s incredibly quick and boots a lot faster than XBian or Raspbmc. It also loads media faster.

Unfortunately, the speed comes at the cost of features. If you want to add special drivers, you have to reinstall OpenELEC from scratch. It also takes a little more technical know-how to get OpenELEC working because the installation process isn’t as easy as something like Raspbmc.

This might feel like a lot to process, but you can relax. We look at media center operating systems more in depth in Chapter 12.

Specialized Distributions

Besides media centers, several other specialized operating system distributions exist for the Raspberry Pi. These distributions might not be built on Linux, but they are designed specifically for the Raspberry Pi. Here are some of the more well-liked ones:

RISC OS: RISC OS (riscosopen.org) was initially released in 1987 as an operating system built for the ARM chipset. That’s the same chip the Raspberry Pi uses, which makes RISC OS great for the Raspberry Pi.

RISC OS isn’t built on anything else; it’s entirely its own operating system, so it’s not as familiar to use. For example, applications don’t get their own executable programs. Instead, they’re just folders with a ! in front of them. It also makes heavy use of the mouse, so if you want to experiment with this operating system, be sure you have a mouse handy. And although RISC OS is similar to Linux in the way it looks, it handles certain operations differently, like multitasking.

RISC OS isn’t as widely supported as Linux by any means, but even with a lack of hardware, it does work well on the Raspberry Pi.

RetroPie: The operating system RetroPie (blog.petrockblock.com/retropie) turns your Raspberry Pi into a dedicated gaming machine. Out of the box, it includes dozens of video game emulators, and you can use it to play old-school games from Nintendo, Sega, and more. RetroPie also supports controllers if you want to add a USB controller instead of using a keyboard and mouse.

OpenWrt: OpenWrt (openwrt.org) is an open-source router operating system. You might not realize it, but your home Wi-Fi router runs its own operating system. OpenWrt is essentially Linux for your router. Once you get it installed, you get a ton of new features for your router, including the ability to set bandwidth caps, add security, and more.

Google Coder: Google Coder (googlecreativelab.github.io/coder) turns your Raspberry Pi into a server you can access from your computer and learn how to do basic coding. It’s all about teaching you basic HTML, JavaScript, and CSS web coding work. (I talk about this a lot more in Chapter 18.)

PI POINTER

Anyone can make a unique distribution of an image for the Raspberry Pi, so plenty of different variations exist. Most are built on an existing version of Linux, but many are specially made just for the Raspberry Pi. So if you’re looking for something in particular, it’s worth searching online to see if someone has made what you need.

Why Raspbian Is Best

With all these options, you might be wondering why Raspbian tends to be the go-to choice for beginners and advanced users alike. The main reason is pretty simple: Raspbian has the most software available on it. Out of the box, it’s already packed with a ton of software you can start using right away.

Similar to making the choice between Windows and OS X, or Android and iPhone, software is the driving choice for most operating systems. On the Raspberry Pi, Raspbian is constantly updated, and most Linux software works on it. So when you boot up Raspbian, you get to run a bunch of software without needing to customize the settings.

It’s also the most full-featured of the operating systems, and it’s built for people who might not be familiar with Linux. It’s also relatively easy to use if you’re familiar with Windows or Mac computers.

If you’ve never used Linux before, Raspbian makes that transition simple by giving you many utilities not always included in Linux. This includes software to set up a Wi-Fi card, an email client, and terminal app so you can use the command line. There’s even an app store to help you find software that works on Raspbian.

There’s a good chance that even if you’re completely unfamiliar with Linux, you’ll understand how to use Raspbian pretty quickly. Its library of software also makes it great for anyone looking to use their Raspberry Pi as a full-blown computer

The Least You Need to Know