How To Install postgresql-server-dev-12 on Ubuntu 20.04

In this tutorial we learn how to install postgresql-server-dev-12 on Ubuntu 20.04. postgresql-server-dev-12 is development files for PostgreSQL 12 server-side programming development files for PostgreSQL 12 server-side programming

Introduction

In this tutorial we learn how to install postgresql-server-dev-12 on Ubuntu 20.04.

What is postgresql-server-dev-12

postgresql-server-dev-12 is:

Header files for compiling SSI code to link into PostgreSQL’s backend; for example, for C functions to be called from SQL.

This package also contains the Makefiles necessary for building add-on modules of PostgreSQL, which would otherwise have to be built in the PostgreSQL source-code tree.

PostgreSQL is an object-relational SQL database management system.

Package: postgresql-server-dev-12 Architecture: amd64 Version: 12.2-4 Priority: optional Section: universe/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: 5219 Depends: clang-10, libpq-dev (>= 12~~), llvm-10-dev, postgresql-client-12 (>= 12.1-2~), postgresql-common (>= 142~) Breaks: postgresql-server-dev-all (« 181~) Filename: pool/universe/p/postgresql-12/postgresql-server-dev-12_12.2-4_amd64.deb Size: 917024 MD5sum: 6c3bf390d8784cee3211c0436b8d7ea6 SHA1: 6b3286fe50a048c348e888ffc3ef02f41af8f8c1 SHA256: 7f3e3fa6ec3874edc7407cd3685605a5400950ba6a61df69c9a065cbea981841 Homepage: http://www.postgresql.org/ Description-en: development files for PostgreSQL 12 server-side programming Header files for compiling SSI code to link into PostgreSQL’s backend; for example, for C functions to be called from SQL.

This package also contains the Makefiles necessary for building add-on modules of PostgreSQL, which would otherwise have to be built in the PostgreSQL source-code tree.

PostgreSQL is an object-relational SQL database management system.

There are three methods to install postgresql-server-dev-12 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 postgresql-server-dev-12 Using apt-get

Update apt database with apt-get using the following command.

sudo apt-get update

After updating apt database, We can install postgresql-server-dev-12 using apt-get by running the following command:

sudo apt-get -y install postgresql-server-dev-12

Install postgresql-server-dev-12 Using apt

Update apt database with apt using the following command.

sudo apt update

After updating apt database, We can install postgresql-server-dev-12 using apt by running the following command:

sudo apt -y install postgresql-server-dev-12

Install postgresql-server-dev-12 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 postgresql-server-dev-12 using aptitude by running the following command:

sudo aptitude -y install postgresql-server-dev-12

How To Uninstall postgresql-server-dev-12 on Ubuntu 20.04

To uninstall only the postgresql-server-dev-12 package we can use the following command:

sudo apt-get remove postgresql-server-dev-12

Uninstall postgresql-server-dev-12 And Its Dependencies

To uninstall postgresql-server-dev-12 and its dependencies that are no longer needed by Ubuntu 20.04, we can use the command below:

sudo apt-get -y autoremove postgresql-server-dev-12

Remove postgresql-server-dev-12 Configurations and Data

To remove postgresql-server-dev-12 configuration and data from Ubuntu 20.04 we can use the following command:

sudo apt-get -y purge postgresql-server-dev-12

Remove postgresql-server-dev-12 configuration, data, and all of its dependencies

We can use the following command to remove postgresql-server-dev-12 configurations, data and all of its dependencies, we can use the following command:

sudo apt-get -y autoremove --purge postgresql-server-dev-12

References

Summary

In this tutorial we learn how to install postgresql-server-dev-12 package on Ubuntu 20.04 using different package management tools: apt, apt-get and aptitude.