How To Install libpq-dev on Ubuntu 20.04
Introduction
In this tutorial we learn how to install libpq-dev
on Ubuntu 20.04.
What is libpq-dev
libpq-dev is:
Header files and static library for compiling C programs to link with the libpq library in order to communicate with a PostgreSQL database backend.
PostgreSQL is an object-relational SQL database management system.
Package: libpq-dev Architecture: amd64 Version: 12.2-4 Priority: optional Section: libdevel Source: postgresql-12 Origin: Ubuntu Maintainer: Ubuntu Developers [email protected] Original-Maintainer: Debian PostgreSQL Maintainers [email protected] Bugs: https://bugs.launchpad.net/ubuntu/+filebug Installed-Size: 568 Depends: libpq5 (= 12.2-4) Suggests: postgresql-doc-12 Filename: pool/main/p/postgresql-12/libpq-dev_12.2-4_amd64.deb Size: 135796 MD5sum: cac46812c57769f9713aea22b99f747f SHA1: 1e3754571e96b7f5fbfc100714cfb11a8e2406da SHA256: b1d9556fea9ed94dea7eeebeccc59bf9598a658e77e6dba5b9197d0f1a22059b Homepage: http://www.postgresql.org/ Description-en: header files for libpq5 (PostgreSQL library) Header files and static library for compiling C programs to link with the libpq library in order to communicate with a PostgreSQL database backend.
PostgreSQL is an object-relational SQL database management system.
There are three methods to install libpq-dev
on Ubuntu 20.04. We can use apt-get
, apt
and aptitude
. In the following sections we will describe each method. You can choose one of them.
Install libpq-dev Using apt-get
Update apt database with apt-get
using the following command.
sudo apt-get update
After updating apt database, We can install libpq-dev
using apt-get
by running the following command:
sudo apt-get -y install libpq-dev
Install libpq-dev Using apt
Update apt database with apt
using the following command.
sudo apt update
After updating apt database, We can install libpq-dev
using apt
by running the following command:
sudo apt -y install libpq-dev
Install libpq-dev Using aptitude
If you want to follow this method, you might need to install aptitude first since aptitude is usually not installed by default on Ubuntu. Update apt database with aptitude
using the following command.
sudo aptitude update
After updating apt database, We can install libpq-dev
using aptitude
by running the following command:
sudo aptitude -y install libpq-dev
How To Uninstall libpq-dev on Ubuntu 20.04
To uninstall only the libpq-dev
package we can use the following command:
sudo apt-get remove libpq-dev
Uninstall libpq-dev And Its Dependencies
To uninstall libpq-dev
and its dependencies that are no longer needed by Ubuntu 20.04, we can use the command below:
sudo apt-get -y autoremove libpq-dev
Remove libpq-dev Configurations and Data
To remove libpq-dev
configuration and data from Ubuntu 20.04 we can use the following command:
sudo apt-get -y purge libpq-dev
Remove libpq-dev configuration, data, and all of its dependencies
We can use the following command to remove libpq-dev
configurations, data and all of its dependencies, we can use the following command:
sudo apt-get -y autoremove --purge libpq-dev
References
Summary
In this tutorial we learn how to install libpq-dev
package on Ubuntu 20.04 using different package management tools: apt
, apt-get
and aptitude
.