Files
oam/knowledge base/dpkg.md
2023-07-09 18:17:32 +02:00

1.6 KiB

Dpkg

Table of contents

  1. TL;DR
  2. Further readings
  3. Sources

TL;DR

# Reconfigure packages.
dpkg-reconfigure --priority 'low' 'unattended-upgrades'

# Find which package provides a file already present on a system.
dpkg -S '/path/to/file'

# Find which files were installed by a package.
dpkg -L 'cfengine3'

# Find which files would be installed by a local package.
dpkg --contents 'cfengine3.deb'

# List available extra architectures.
dpkg-architecture --list-known

# Add extra architectures.
dpkg --add-architecture 'i386'

# List added extra architectures.
dpkg --print-foreign-architectures

# List all installed packages of the i386 architecture.
dpkg --get-selections | grep 'i386' | awk '{print $1}'

# Remove all traces of the i386 architecture.
apt-get purge \
  "$(dpkg --get-selections | grep --color=never 'i386' | awk '{print $1}')" \
&& dpkg --remove-architecture 'i386'

Further readings

Sources

All the references in the further readings section, plus the following: