8

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.

Jawa
  • 3,619
  • 13
  • 31
  • 36
Moe
  • 91
  • 1
  • 1
  • 2

3 Answers3

12

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: http://www.cyberciti.biz/faq/installing-rhel-epel-repo-on-centos-redhat-7-x/

PatrickBM
  • 121
  • 1
  • 2
  • These commands raise the error "nothing provides lzma needed by dpkg-dev-1.18.25-12.el8.noarch" on centos8. However `yum install dpkg` after installing epel-release worked – Andy Ray Jan 06 '20 at 01:36
7

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

dpkg is for debian (ubuntu) based distributions.

akira
  • 61,009
  • 17
  • 135
  • 165
3

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

Qouted from http://pkgs.org/centos-6/epel-i386/dpkg-1.15.5.6-6.el6.i686.rpm.html

  1. Download the latest epel-release rpm from http://dl.fedoraproject.org/pub/epel/6/i386/
  2. Install epel-release rpm:

    rpm -Uvh epel-release*rpm

  3. Install dpkg rpm package:

    yum install dpkg

keji
  • 169
  • 1
  • 7