📦

Debian Package Management

Jul 20, 2025

Overview

This lecture covers managing Debian packages in Linux, focusing on installing, removing, and listing packages using command-line tools.

Linux Distributions and Package Types

  • Linux distributions (distros) use different package formats; Red Hat uses .rpm, Debian uses .deb files.
  • Ubuntu, based on Debian, also uses .deb package files.

Installing and Removing Debian Packages

  • Standalone Debian packages have the .deb extension.
  • Use the dpkg -i <package>.deb command to install a Debian package ("-i" means install).
  • Remove a package with the command dpkg -r <package> ("-r" stands for remove).

Listing and Searching Installed Packages

  • List all installed Debian packages with dpkg -l ("-l" stands for list).
  • To search for a specific package, pipe the output of dpkg -l to grep, e.g., dpkg -l | grep <package>.
  • The pipe (|) operator sends the output of one command to another.

Key Terms & Definitions

  • Distribution (Distro) — A version of Linux with its own system and package management.
  • .rpm package — Red Hat Package Manager format used by Red Hat-based distros.
  • .deb package — Debian package file format used by Debian-based distros.
  • dpkg — Debian package manager command-line tool for managing .deb packages.
  • Pipe (|) — Sends output of one command as input to another in the command line.
  • grep — Command-line tool for searching text using patterns.

Action Items / Next Steps

  • Practice installing and removing .deb packages using dpkg -i and dpkg -r.
  • Use dpkg -l and grep to list and search for installed packages.
  • Review command-line basics if needed for pipes and searching with grep.