virt-pki-query-dn command not found

In this troubleshooting guide we learn how to fix virt-pki-query-dn command not found error message

Introduction

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

virt-pki-query-dn: command not found

or when using sudo you get the following error message

sudo: virt-pki-query-dn: command not found

Solutions to virt-pki-query-dn: command not found

How To Fix virt-pki-query-dn: command not found in Ubuntu / Debian / Kali Linux / Raspbian

In Ubuntu virt-pki-query-dn is provided by libvirt-clients package.

libvirt-clients is:

Libvirt is a C toolkit to interact with the virtualization capabilities of recent versions of Linux (and other OSes). The library aims at providing a long term stable C API for different virtualization mechanisms. It currently supports QEMU, KVM, XEN, OpenVZ, LXC, and VirtualBox.

This package contains the libvirt shell virsh and other client binaries.

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

sudo apt-get -y install libvirt-clients

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

You can also use apt command to install libvirt-clients.

sudo apt -y install libvirt-clients

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

sudo aptitude install libvirt-clients

Summary

In this tutorial we learn how to fix virt-pki-query-dn command not found error in Ubuntu / Debian / Kali Linux or Raspbian distribution.