dpkg-ruby command not found

In this troubleshooting guide we learn how to fix dpkg-ruby command not found error message

Introduction

When you run more command in linux terminal / console, you get the following error message

dpkg-ruby: command not found

or when using sudo you get the following error message

sudo: dpkg-ruby: command not found

Solutions to dpkg-ruby: command not found

How To Fix dpkg-ruby: command not found in Ubuntu / Debian / Kali Linux / Raspbian

In Ubuntu dpkg-ruby is provided by ruby-debian package.

ruby-debian is:

This package provides Debian::Dpkg and Debian::DpkgDeb modules and Debian::Deb, Debian::Dsc, Debian::Archives, Debian::Sources, Debian::Packages and Debian::Status classes for ruby.

It also provides two scripts, dpkg-ruby (a dpkg-awk clone) and dpkg-checkdeps (a utility to check for deb dependency problems).

To fix this problem, we can install more using the command below.

sudo apt-get -y install ruby-debian

This command might take some time to finish depending on your machine internet connection.

You can also use apt command to install ruby-debian.

sudo apt -y install ruby-debian

Or if you have aptitude installed you can use the following command.

sudo aptitude install ruby-debian

Summary

In this tutorial we learn how to fix dpkg-ruby command not found error in Ubuntu / Debian / Kali Linux or Raspbian distribution.