π₯ Raspberry Pi β Install .deb Files & Python Libraries (2025 Beginnerβs Guide)
π§² Introduction β Expand Your Raspberry Pi with External Software
Raspberry Pi supports thousands of packages through its default APT repositoriesβbut for more flexibility, you can install external .deb packages and Python libraries. These unlock everything from custom software and system tools to AI libraries and IoT integrations.
π― In this guide, youβll learn:
- How to install
.debfiles on Raspberry Pi - Handle dependency errors with
dpkgandapt - Use
pipto install and manage Python libraries - Explore real-world use cases like Flask, NumPy, and GPIO packages
π¦ What is a .deb File?
A .deb file is a Debian software packageβused to install software manually on Debian-based systems like Raspberry Pi OS.
β
Installing .deb files allows you to:
- Use software not in APT repos
- Try newer versions than those in official repos
- Distribute custom-built software offline
π How to Install .deb Files on Raspberry Pi
β
Step 1: Download the .deb File
Example (AnyDesk):
wget https://download.anydesk.com/rpi/anydesk_6.2.1-1_armhf.deb
β
Step 2: Install Using dpkg
sudo dpkg -i anydesk_6.2.1-1_armhf.deb
β οΈ Step 3: Fix Broken Dependencies
If you see dependency errors, run:
sudo apt --fix-broken install
This automatically installs missing dependencies.
π Alternative: Use apt install ./filename.deb
sudo apt install ./anydesk_6.2.1-1_armhf.deb
β This method automatically resolves dependenciesβsafer for beginners.
π Useful .deb Sources for Raspberry Pi
| π Website | π Description |
|---|---|
| AnyDesk | Remote desktop for Raspberry Pi |
| BalenaEtcher | SD card imaging tool |
| VSCodium | Open-source Visual Studio Code variant |
| TeamViewer | Remote access and screen sharing |
π Installing Python Libraries on Raspberry Pi
Python is preinstalled on Raspberry Pi OS. You can use pip or pip3 to manage Python packages.
β
Step 1: Install pip (if not already installed)
sudo apt install python3-pip -y
β
Step 2: Install a Package via pip3
Example β Flask (web framework):
pip3 install flask
Example β NumPy (scientific computing):
pip3 install numpy
Example β GPIO Zero (for GPIO control):
pip3 install gpiozero
π¦ Useful Python Libraries for Raspberry Pi
| π Library | π Description |
|---|---|
| gpiozero | High-level GPIO pin control |
| RPi.GPIO | Low-level GPIO access (deprecated for Pi 5) |
| flask | Web apps & REST APIs |
| requests | HTTP requests (GET/POST) |
| numpy | Scientific computing |
| paho-mqtt | MQTT communication for IoT |
| opencv-python | Computer vision (camera input, filters) |
| matplotlib | Plotting graphs and charts |
| scikit-learn | Machine learning tools |
π§Ό Uninstalling .deb Files and Python Packages
β
Uninstall a .deb package:
sudo apt remove <package-name>
sudo apt autoremove
β Uninstall a Python package:
pip3 uninstall <package-name>
β Always clean up unused dependencies to keep your system fast and secure.
π Summary β Recap & Next Steps
Youβve learned how to install .deb packages and Python libraries on Raspberry Pi to extend its functionality. This enables local development, GUI apps, and custom tools for automation and IoT.
π Key takeaways:
- Use
dpkgorapt install ./filename.debfor.debfiles - Use
pip3 install <package>for Python packages - Common use cases include GUI tools, remote access, GPIO control, and web apps
- Clean up old packages to save space
βοΈ Real-world relevance: From camera apps to AI dashboards, your Pi becomes a true Linux workstation with the right packages.
β FAQs β Installing .deb and Python Packages
β How do I find out what dependencies are missing for a .deb file?
β Run:
sudo apt --fix-broken install
It will list and install missing packages automatically.
β Should I use pip or apt for Python libraries?
β
Use pip for latest versions. Use apt only when a library is available system-wide (like python3-numpy).
β Can I install packages offline?
β
Yes. Download .deb or whl files and transfer via USB, then install locally.
β Whatβs the difference between pip and pip3?
β
pip3 is for Python 3. Always use pip3 on Raspberry Pi OS.
β How do I update an existing Python package?
pip3 install --upgrade <package-name>
Share Now :
