Your Raspberry Pi-based computer is now all assembled and working. Now what? It’s time to learn how to use the basic user interface. If you’ve ever used Windows or a Mac, you already know how the mouse and keyboard work, but the menus and controls in Raspbian are a little different. We’ll also spend some time explaining several different ways that software and apps can be installed, and this is significantly different from other operating systems, so you’ll absolutely need take a few notes here.
Using the Interface
Beneath the raspberry icon is an icon for the trash can, and, if you plugged in an external hard drive, one or more hard drive icons should appear here.
These buttons allow you to control Bluetooth (the Bluetooth logo), Wi-Fi and Ethernet (the up/down arrows), and the audio volume (the speaker icon).
Next to that is a simple meter that shows how much CPU capacity is being used (in percent), followed by a clock/calendar, and lastly you will find an “eject button icon” that you can use to eject media such as flash drives and other removable media.
Under Preferences ➤ Desktop Preferences, you can change the colors of the menu bar; and under the “Desktop” tab, you can change the background picture, or if you don’t want a background photo, you can choose a plain, single-color background.
Overall, you’ll find that working with the Raspbian desktop is a lot like working with Windows or Mac in the way things work. Right-clicking the mouse or two-finger trackpad clicking will often bring up some kind of contextual menu, items can be dragged around the desktop, and cut and paste options work just about the same as they do on other systems.
Shutting Down the System
With most modern operating systems, you have to go through a “shutdown process” before you turn off your computer, and the Pi is no different. When you are ready to turn off (or reboot) your Raspberry Pi, you can do this from either the desktop or the command line.
From within the GUI, click the raspberry icon, and the last thing on the dropdown menu is “Shutdown.” You’ll see a dialog box with three choices: Shut Down, Reboot, and Cancel.
The File Manager
The system file structure is displayed in the left pane, while the various folders and files show up in the right pane. Across the top is the menu bar. In the file structure pane, you can expand or collapse folders either by clicking the plus or minus signs next to the folder icons or by double-clicking them.
Keep in mind that if you are coming from a Windows background, the Linux file structure is very different from what you may be used to. You have full access (called permissions in Linux) to delete, copy, and manipulate most files within your own user account folder (called “brian” in the screenshot in Figure 3-6); but you cannot alter things outside that directory unless you use the sudo command . The only way to run a sudo command is to type it from the command line. This may seem like an annoyance, but it’s a security feature that is time-tested in decades of Unix use.
Installing Apps
There are a lot of great apps already installed with Raspbian; there’s an office app, a web browser, a media player, and a lot of other useful things. If you haven’t already, now would be a great time to browse through the menus and see what all is in there. Even with all that, the Raspbian folks obviously couldn’t include everything out there, since Raspbian is essentially just a version of Linux, and there are a vast number of apps available for that. Once in a while, you’ll hear about some great thing that didn’t come included with Raspbian that you want to try.
There are three primary ways to install software on Raspbian: compiling it from source code, downloading it from the Ubuntu repositories, or installing it from the command line.
Building Apps from Source Code
This is the hardest way to do it, and unless you know what you’re doing, I wouldn’t go this route unless the software you want has very explicit instructions for building the app. Most Raspbian apps are open source software, meaning that you can actually download and read the programming code that went into making the software.
Some apps that are still in development only offer this source code, and the code has to be compiled in order to run. There are a lot of variables involved with available libraries, tools, and languages; so unless you just absolutely have to build the app, look for an easier way.
Installing Apps from the Add/Remove Software Tool
You can browse the categories in the left pane and then scroll through the lists of apps in the right pane. If you know the specific name of something you want to install, type it in the search box. If you find an app that you want to try, select it and click OK. After a few moments, the app should be downloaded and installed for you. After an app has been installed, it will show up on this list with a checkmark next to it. If you uncheck the box and click “Apply,” it will be uninstalled. Easy!
And here it’s very clear that I have two apps that need updating. Click “Install Updates,” and they’ll download and install the updates for you.
There are two problems with this method. First, there’s not much description of what everything is, so unless you have a specific app or tool in mind, you may never find it. Second, this tool doesn’t work remotely. You can run the Add/Remove Software tool in VNC, but the software will not install. This may be a security feature, or it may be a bug, but it will not work.
Installing Apps from the Command Line
The Add/Remove Software tool that we just described is really easy to use, but you may soon find that the selection of apps is still somewhat limited. There’s a lot of good stuff there, and I strongly recommend browsing and exploring those apps, but there are a huge number of very powerful apps that still aren’t included in that list. I have found the command line is the easiest way to install just about anything I ever wanted. There’s nothing complicated at all about this, but the one requirement is that you have to know the name of the package you want in advance. This requires some reading or some Internet research, but once you know what you want, getting it is easy.
The first line updates all the repositories. These online repositories index all the available apps and tools that are available and the Internet locations that hold the install files for them. They change constantly with new versions and new tools being added all the time, so I always run this update command first, just to make sure the newest versions are found.
In the second line, sudo is once again the command that gives you superuser permissions, which is required to install software. Apt is short for Advanced Packaging Tool , and it is the app that does the installation. Install is what we specifically want the apt program to do, and packagename should be replaced with the name of the package we want to install.
Neofetch is a nice little command-line app that prints out the textual-graphic representation of the Raspbian logo and reports on some technical stuff about our little machine as well. It’s not super useful, but it wasn’t there before we installed it!
Again, the first line loads in a fresh list of repositories, and then the second line upgrades everything that has an available update.
But be aware that you probably already have the latest full distribution of Raspbian—it may only be updated once or twice a year, so most of the time this won’t do anything.
Note that there are also other ways of installing software from the command line. We looked at apt (Advanced Packaging Tool) earlier, but there are also pip (Package Installer for Python) and curl (Copy from URL) that are also used occasionally. Which one you use depends on various factors: pip is used to install Python scripts, and curl is used to download and install directly over the Internet. The vast majority of apps install using apt, but be on the lookout for the occasional app that needs one of the others. Of course, I’ll give the installation command for each app that we look at here.
OK, now we are able to search for, install, delete, and update software any which way we want using apt. Now it’s time to get some work done!
Cleaning Up the Raspbian Menus
Raspbian installs many of the most common apps and tools that the Raspberry Pi Foundation believes people are most likely to use. The vast majority of people who buy a Pi are doing so to do electronics projects and experimenting. This means there are a lot of scientific, electronics, programming, and interfacing apps on the Pi; and we aren’t going to want those at all in our “getting work done” desktop. We could go through and uninstall all of the things we don’t want, but in some cases, these apps include files and libraries that may be used by other apps, and we don’t want to cause problems by deleting the wrong things. So rather than uninstall them, we can simply remove them from the menus. The menu editor can be found under Raspberry ➤ Preferences ➤ Main Menu Editor.
As a side note, it’s probably a good idea to skim through all the menus and take a look at what’s there. There are a number of apps that are already installed on your system, but their menu entries are already grayed out by default. If you want to try these apps, just turn them on and explore.
This allows us to create a menu item for literally anything. Type in some text for the Name field and, optionally, the Comment field. Both of these can say anything you like. In the Command field, you have two choices: you can enter in the exact same text you would use to start an app on the command line, or you can click the button and browse to where the app is located in the file system. There’s also a checkbox that lets you run the command in a terminal window. If you are running some kind of GUI app, then you don’t need the terminal, but if you want to run a command-line app, then launching it in the terminal allows it to be interactive. In addition, if you have an icon image that you would like to assign to this menu item, you can click the generic icon picture and choose a new one.
Let’s take a common command-line action and make a menu item out of it. For our example, we know that sudo apt update is the command that updates your software repositories. It’s common to do this before installing anything, just so you can be sure you are getting the newest version of the software. Still, you don’t have to actually type that every time; you can make it a menu item.
To do this, you’d type
Update Repositories in the Name field
sudo apt update in the Command field
Update things before downloading a new app in the Comment field.
Cloud Services
One thing that I’ve found incredibly useful over the years is making heavy use out of some kind of cloud syncing service. Dropbox, Google Drive, OneDrive, iCloud, and a dozen other options are available for Windows and Mac, but what’s out there for our little Pi?
Well, there’s bad news and there’s good news. None of the major cloud storage providers have a native app that works on the Raspberry Pi. At one time, there was a workaround that allowed Dropbox to work, but Dropbox made changes that broke that. Insynchq.com makes a test version of their client that they claim will work, but I’ve never managed to get it to install properly. Keep an eye out for this; they may get it fully working someday.
In the meantime, all the major services will work through their respective web interfaces. It’s not the same as having an integrated native app that will sync folders seamlessly in the background, but at least you can make use of your favorite service to upload and download files manually. As the RPi devices become more powerful, these providers will see the benefit of creating a native interface, so expect changes here.
Conclusion
Now you’ve gotten into the desktop interface, gone through the menus, and maybe customized a few of them; and more importantly, we learned several different methods of installing new apps, and we’ll need all of them. One of the often-debated weaknesses of Linux is the complexity of installing software and apps, and the simple fact that we just looked at multiple ways to do it proves that true.
Still, we know how it’s done now, so in the next chapter, we’ll look at the best apps for the Raspberry Pi desktop.