Raspberry Pi - Managing Software
Raspberry Pi - Managing Software
Section titled “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.
Using the Command Line (apt)
Section titled “Using the Command Line (apt)”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.
Updating Package Lists
Section titled “Updating Package Lists”Before installing or upgrading software, always update the local list of available packages from the repositories:
sudo apt updateThis command downloads the latest package information (versions, dependencies) but doesn’t install or upgrade any software itself.
Upgrading Installed Packages
Section titled “Upgrading Installed Packages”To upgrade all installed packages to their newest available versions:
sudo apt upgradeThis 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).
Searching for Software
Section titled “Searching for Software”To search for available packages by name or description:
apt search search_termExample: apt search chess will list packages related to chess.
To get detailed information about a specific package (version, dependencies, description):
apt show package_nameExample: apt show python3-gpiozero
Installing Software
Section titled “Installing Software”Once you know the package name, install it using:
sudo apt install package_nameExample: 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).
Removing Software
Section titled “Removing Software”To remove an installed package:
sudo apt remove package_nameExample: 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_nameCleaning Up Unused Packages
Section titled “Cleaning Up Unused Packages”After removing software, some dependencies might no longer be needed by any installed package. To remove these orphaned dependencies:
sudo apt autoremoveIt’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.
Running Software
Section titled “Running Software”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.
Listing Installed Software
Section titled “Listing Installed Software”To see a list of all installed packages using the command line:
apt list --installedThis list can be very long. You can filter it using grep:
apt list --installed | grep pythonAlternatively, using the older dpkg command:
dpkg -ldpkg -l | grep python