πŸ“¦ 7. Raspberry Pi – Software Management
Estimated reading: 3 minutes 111 views

πŸ“₯ 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 .deb files on Raspberry Pi
  • Handle dependency errors with dpkg and apt
  • Use pip to 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
AnyDeskRemote desktop for Raspberry Pi
BalenaEtcherSD card imaging tool
VSCodiumOpen-source Visual Studio Code variant
TeamViewerRemote 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
gpiozeroHigh-level GPIO pin control
RPi.GPIOLow-level GPIO access (deprecated for Pi 5)
flaskWeb apps & REST APIs
requestsHTTP requests (GET/POST)
numpyScientific computing
paho-mqttMQTT communication for IoT
opencv-pythonComputer vision (camera input, filters)
matplotlibPlotting graphs and charts
scikit-learnMachine 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 dpkg or apt install ./filename.deb for .deb files
  • 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 :
Share

πŸ“₯ Raspberry Pi – Install .deb Files & Python Libraries

Or Copy Link

CONTENTS
Scroll to Top