ZNHOO Whatever you are, be a good one!

Ubuntu and Debian

  1. dpkg
  2. apt and apt-get

dpkg

dpkg is the underlying tool of apt-get.

Metadata.

~ $ dpkg --info/-I kong-enterprise-edition_2.8.4.2_all.deb
 new Debian package, version 2.0.
 size 58635042 bytes: control archive=104837 bytes.
       1 bytes,     0 lines      conffiles
     524 bytes,    12 lines      control
  366935 bytes,  3828 lines      md5sums
     862 bytes,    30 lines   *  postinst
 Package: kong-enterprise-edition
 Version: 2.8.4.2
 Section: default
 Priority: extra
 Architecture: all
 Maintainer: Kong Inc. <support@konghq.com>
 Installed-Size: 220993
 Replaces: kong-community-edition, kong-enterprise-edition-fips
 Provides: kong, lapis, luarocks, luarocks-admin
 Depends: ca-certificates, libpcre3, perl, zlib1g-dev, libyaml-0-2
 Conflicts: kong-community-edition, kong-enterprise-edition-fips
 Description: Kong is a distributed gateway for APIs and Microservices, focused on high performance and reliability.

# all fields
~ $ dpkg --field/-g kong-enterprise-edition_2.8.4.2_all.deb
Package: kong-enterprise-edition
Version: 2.8.4.2
Section: default
Priority: extra
Architecture: all
Maintainer: Kong Inc. <support@konghq.com>
Installed-Size: 220993
Replaces: kong-community-edition, kong-enterprise-edition-fips
Provides: kong, lapis, luarocks, luarocks-admin
Depends: ca-certificates, libpcre3, perl, zlib1g-dev, libyaml-0-2
Conflicts: kong-community-edition, kong-enterprise-edition-fips
Description: Kong is a distributed gateway for APIs and Microservices, focused on high performance and reliability.

# specific field
~ $ dpkg -f kong-enterprise-edition_2.8.4.2_all.deb Version
2.8.4.2

# contents of deb file
~ $ dpkg --contents/-c kong-enterprise-edition_2.8.4.2_all.deb

# congents of repo pkg
~ $ dpkg --listfiles/-L kong-enterprise-edition

Install.

~ $ sudo dpkg --install kong-enterprise-edition_2.8.4.2_all.deb

# optionally if needs to install depenency
~ $ sudo apt-get update
~ $ sudo apt-get --fix-broken install

~ $ kong version

Remove.

# keep config and runtime data
~ $ sudo dpkg --remove/-r <pkg-name>

# clean config and runtime data
~ $ sudo dpkg --pruge/-p <pkg-name>

apt and apt-get

apt is a user-friendly high-level wrapper of apg-get and mainly used on Debian system, but please apt-get is the default on Ubuntu system. Nowadays, both apt and apt-get are avaiable on Ubuntu and Debian.

Search.

~ $ apt list --all-versions kong-enterprise-edition

~ $ apt-cache show kong-enterprise-edition | grep [V]ersion

~ $ apt/apt-cache policy kong-enterprise-edition

Install.

# pathname to deb file
~ $ sudo apt/apt-get install ./kong-enterprise-edition_2.8.4.2_all.deb

# search from repo
~ $ sudo apt/apt-get install <pkg-name>=<pkg-version>

Remove.

~ $ sudo apt/apt-get remove <pkg-name>

~ $ sudo apt/apt-get autoremove