How to Install Linux Software on Your Raspberry Pi
As you’ve guessed now, in Linux, basic file operations are not completely simple. So you may think that installing software on your Raspberry Pi is even harder.
It’s not! Or rather it is, but Linux makes it easy for you.
Linux uses a tool called a package manager to install software. A lot of software relies on other software, and you have to install all of it to get something working. The complete blob of everything that gets downloaded when you install software is called a package.
When software needs other software to work, the second software is called a dependency.
In Raspbian and Debian, the package manager command is apt-get. It works like this:
sudo apt-get install package-name
You get the package name by looking online. Often someone tells you the name.
apt-get often asks you yes/no to confirm that you want to go ahead. You can skip this step by including the –y switch:
sudo apt-get install –y package-name
As apt-get works, you see a lot of messages scrolling by. You can ignore them all.
One thing you can’t ignore is the Internet. apt-get only works if your Pi has an Internet connection.
The other one thing you can’t ignore is sudo. You have to include it when you install software — always.
Updating and upgrading Linux software on your Pi
Although Linux gets packages from the Internet, it keeps a list of dependencies on your Pi. Packages change all the time as the developers who put them together add new options and fix problems.
To make sure all dependencies are up to date, run
sudo apt-get update
before you install anything. You won’t break anything if you don’t, but it’s a good idea to work with a fresh package list.
If you want to get the very latest versions of software you installed already, run
sudo apt-get upgrade
This command upgrades all the software on your Pi to the latest version. It can take a while to run, so you don’t need to do it often. The following figure shows one example output. You have to press Y and Enter to confirm.
Uninstalling Linux software on your Pi
You don’t often need to uninstall software on a Pi. You won’t usually run out of space on your memory card.
But just in case you do, you can use either of two commands:
sudo apt-get remove package-name sudo apt-get purge package-name
Remove deletes the software. Purge deletes the software and all its settings — which is useful if you mess up the settings and you need to start again.