"-bash: line 7: dpkg: command not found" said CentOS

I'd like to use the command dpkg in my PHP script (using exec).

I'm running CentOS. Is there a way I can install the command dpkg on there?

Step by step guide would be fantastic.

3 Answers

These steps worked for me on CentOS 7:

  1. Install epel using the following command: sudo yum -y install epel-release
  2. Refresh repo by typing the following commad: sudo yum repolist
  3. Install the dpkg rpm packages: sudo yum install dpkg-devel dpkg-dev

For more information:

1

with centos you should be using yum, since it is the package manager of centos.

dpkg is for debian (ubuntu) based distributions.

3

For those who wanted to know: you can install dpkg.

Qouted from

  1. Download the latest epel-release rpm from
  2. Install epel-release rpm:

    rpm -Uvh epel-release*rpm

  3. Install dpkg rpm package:

    yum install dpkg

Your Answer

Sign up or log in

Sign up using Google Sign up using Facebook Sign up using Email and Password

Post as a guest

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

You Might Also Like