Skip to content
This repository has been archived by the owner on Apr 6, 2023. It is now read-only.

Dpkg rpm comparison

dpilgrim edited this page Jul 19, 2011 · 1 revision

Package Management

dpkg and rpm, respectively, handle package management for Debian-based and Red Hat-based distributions, respectively. These are common package management tasks for each.

Install package

  • dpkg: dpkg -Gi package(s).deb
  • rpm: rpm -Uvh packages(s).rpm

Upgrade package

  • dpkg -Gi package(s).deb
  • rpm -Uvh packages(s).rpm

Remove package

  • dpkg -r package
  • dpkg -e package

List what package depends on

  • dpkg -s package | grep ^Depends:
  • rpm -q —requires package

List what is dependent on package

  • dpkg —purge —dry-run package
  • rpm -q —whatrequires package

List metadata of package

  • dpkg -I package.deb
  • rpm -q -i -p package.rpm

List version of installed package

  • dpkg -l package
  • rpm -q package

Extract contents of package to current directory

  • dpkg -x package.deb
  • rpm2cpio package.rpm | cpio -id

Repository Management

A collection of mutually compatible packages and versions is called a distribution. An accessible online store (or online pointer to stores) of a distribution is called a repository. apt is the repository management tool for dpkg, and yum is the repository management tool for rpm. These are common repository management tasks for each.

Update local cache of repository package list

  • apt-get update
  • yum auto-updates each time it is called

List locally known respositories

  • cat /etc/apt/sources.list
  • yum repolist

Install package

  • apt-get -i package
  • yum install package

Upgrade to new distribution

  • apt-get dist-upgrade
  • yum upgrade

Remove package

  • apt-get remove package
  • yum erase package

Search for package name pattern in repository

  • apt-cache search pattern
  • yum search pattern
Clone this wiki locally