pg_activity command not found

In this troubleshooting guide we learn how to fix pg_activity command not found error message

Introduction

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

pg_activity: command not found

or when using sudo you get the following error message

sudo: pg_activity: command not found

Solutions to pg_activity: command not found

How To Fix pg_activity: command not found in Ubuntu / Debian / Kali Linux / Raspbian

In Ubuntu pg_activity is provided by pg-activity package.

pg-activity is:

PgActivity is a curses-based realtime utility to display information from a running PostgreSQL database server.

It is modelled after the standard ’top’ utility, and displays information such as:

  • the running, waiting and blocking queries
  • cpu, memory and i/o usage of each query
  • the queries execution time

It also provides interactive commands to sort, filter, scroll and extend the queries list displayed.

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

sudo apt-get -y install pg-activity

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

You can also use apt command to install pg-activity.

sudo apt -y install pg-activity

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

sudo aptitude install pg-activity

Summary

In this tutorial we learn how to fix pg_activity command not found error in Ubuntu / Debian / Kali Linux or Raspbian distribution.