Easily Identify and Manage Your Raspberry Pi’s Software Stack
Learn how to list installed packages, search for specific packages, and remove unwanted software on your Raspberry Pi. Master package management with these simple commands. …
Updated September 3, 2023
Learn how to list installed packages, search for specific packages, and remove unwanted software on your Raspberry Pi. Master package management with these simple commands.
Check Installed Packages
To check all the packages installed on your Raspberry Pi, open a terminal window and type the following command:
dpkg --get-selections
This will output a list of all installed packages along with their current status (installed or deinstalled). The output may look something like this:
libpam-systemd install
libraspberrypi0 install
libsystemd0:amd64 install
libudev1:amd64 install
libudev1:i386 install
lightdm install
linux-firmware install
locales install
login install
Search for a Package
If you want to search for a specific package, use the dpkg -l
command with a keyword. For example, if you’re looking for all packages related to Python:
dpkg -l | grep python
This will output all installed packages containing the word “python,” such as:
ii libpython3-stdlib:amd64 3.7.3-1+rpi1 amd64 interactive high-level object-oriented language (default python3 version)
ii python3 3.7.3-1+rpi1 amd64 interactive high-level object-oriented language (version 3)
Remove a Package
To remove an installed package, use the apt-get
command with the --purge
option:
sudo apt-get --purge remove <package_name>
For example, to remove the “lightdm” package:
sudo apt-get --purge remove lightdm
This will prompt you for confirmation before removing the package and its configuration files. If you’re sure you want to remove a package and all its dependencies, use the --auto-remove
option as well:
sudo apt-get --purge --auto-remove <package_name>
Conclusion
Now you know how to check installed packages on your Raspberry Pi, search for specific ones, and remove unwanted software. With these commands at your disposal, you can manage your Pi’s software stack more effectively and efficiently. Remember that using sudo
is necessary for most package management commands, as they require administrative privileges.