Skip to content

Raspberry Pi - Managing Software

Raspberry Pi OS uses the Debian package management system, primarily APT (Advanced Package Tool), to handle software installation, updates, and removal. You can manage software using graphical tools or command-line commands.

The apt command is the modern, recommended tool for managing packages in the terminal. Most package management actions require administrative privileges, so commands are typically prefixed with sudo.

Before installing or upgrading software, always update the local list of available packages from the repositories:

sudo apt update

This command downloads the latest package information (versions, dependencies) but doesn’t install or upgrade any software itself.

To upgrade all installed packages to their newest available versions:

sudo apt upgrade

This command will show you which packages will be upgraded and ask for confirmation (Y/n). Use sudo apt upgrade -y to automatically answer yes.

apt upgrade will not remove currently installed packages or install new ones if needed to satisfy dependencies for an upgrade. For major OS version upgrades, sudo apt full-upgrade might be required (use with caution, read prompts carefully).

To search for available packages by name or description:

apt search search_term

Example: apt search chess will list packages related to chess.

To get detailed information about a specific package (version, dependencies, description):

apt show package_name

Example: apt show python3-gpiozero

Once you know the package name, install it using:

sudo apt install package_name

Example: sudo apt install gimp

APT will automatically handle downloading the package and any necessary dependencies. It will ask for confirmation before proceeding (unless you add the -y flag).

To remove an installed package:

sudo apt remove package_name

Example: sudo apt remove gimp

This removes the package files but may leave behind configuration files.

To remove a package and its configuration files:

sudo apt purge package_name

After removing software, some dependencies might no longer be needed by any installed package. To remove these orphaned dependencies:

sudo apt autoremove

It’s good practice to run this occasionally after removing software.

Using Graphical Tools (Add/Remove Software)

Section titled “Using Graphical Tools (Add/Remove Software)”

If you prefer a graphical interface, Raspberry Pi OS Desktop includes a tool for managing software.

Access: Application Menu -> Preferences -> Add/Remove Software

This tool allows you to:

  • Browse applications by category.
  • Search for applications by name or description.
  • View details about applications.
  • Mark applications for installation or removal.
  • Apply changes (which will usually require your password).

Behind the scenes, this tool uses the same APT system as the command-line commands.

Once installed, software can usually be run in one of two ways:

  • From the Application Menu: Most graphical applications will appear in the appropriate category within the main menu.
  • From the Command Line: Type the program’s executable name in the terminal and press Enter (e.g., gimp, vlc, python3). Some programs might only be designed for command-line use.

To see a list of all installed packages using the command line:

apt list --installed

This list can be very long. You can filter it using grep:

apt list --installed | grep python

Alternatively, using the older dpkg command:

dpkg -l
dpkg -l | grep python