Postgresql for kali linux

postgresql on Kali Linux

Please follow the instructions below to install postgresql package:

2. Uninstall / Remove postgresql package

This tutorial shows how to uninstall postgresql package:

3. Details of postgresql package

Package: postgresql
Source: postgresql-common (242)
Version: 14+242
Installed-Size: 70
Maintainer: Debian PostgreSQL Maintainers
Architecture: all
Depends: postgresql-14
Suggests: postgresql-doc
Size: 66684
SHA256: e9b26de5e6a20490f24d9e91dfc2e8f83823dfcb27638f6f1b5f37a7ffa01d4e
SHA1: 9472a4a7832ca3da9a674f1f1dfc9255a77126bf
MD5sum: fd99f32a464c78f0c49583e6af5ae943
Description: object-relational SQL database (supported version)
This metapackage always depends on the currently supported PostgreSQL
database server version.
.
PostgreSQL is a fully featured object-relational database management
system. It supports a large part of the SQL standard and is designed
to be extensible by users in many aspects. Some of the features are:
ACID transactions, foreign keys, views, sequences, subqueries,
triggers, user-defined types and functions, outer joins, multiversion
concurrency control. Graphical user interfaces and bindings for many
programming languages are available as well.
Description-md5: bdff2d6e5b2a1dd00e72b3ed8729d9ac
Tag: devel::lang:sql, interface::daemon, network::server, network::service,
role::metapackage, role::program, suite::postgresql, works-with::db
Section: database
Priority: optional
Filename: pool/main/p/postgresql-common/postgresql_14+242_all.deb

4. References on Kali Linux

5. The same packages on other Linux Distributions

postgresql (10+190ubuntu0.1) Ubuntu 18.04 LTS (Bionic Beaver)

postgresql (9.5+173ubuntu0.3) Ubuntu 16.04 LTS (Xenial Xerus)

postgresql (13+226) Ubuntu 21.10 (Impish Indri)

postgresql (14-10.6.2) openSUSE Leap

postgresql (14-2.2) openSuSE Tumbleweed

postgresql (14+238) Ubuntu 22.04 LTS (Jammy Jellyfish)

postgresql (11+200+deb10u4) Debian 10 (Buster)

Источник

How To Install postgresql-13 on Kali Linux

In this tutorial we learn how to install postgresql-13 on Kali Linux.

What is postgresql-13

PostgreSQL, also known as Postgres, is a free and open-source relational database management system (RDBMS) emphasizing extensibility and SQL compliance. It features transactions with Atomicity, Consistency, Isolation, Durability (ACID) properties, automatically updatable views, materialized views, triggers, foreign keys, and stored procedures. It is designed to handle a range of workloads, from single machines to data warehouses or Web services with many concurrent users.

This package provides the database server for PostgreSQL 13.

There are three ways to install postgresql-13 on Kali Linux . We can use apt-get , apt and aptitude . In the following sections we will describe each method. You can choose one of them.

Читайте также:  Internal server error apache2 linux

Install postgresql-13 Using apt-get

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

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

sudo apt-get -y install postgresql-13 

Install postgresql-13 Using apt

Update apt database with apt using the following command.

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

sudo apt -y install postgresql-13 

Install postgresql-13 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 Kali Linux. Update apt database with aptitude using the following command.

After updating apt database, We can install postgresql-13 using aptitude by running the following command:

sudo aptitude -y install postgresql-13 

How To Uninstall postgresql-13 on Kali Linux

To uninstall only the postgresql-13 package we can use the following command:

sudo apt-get remove postgresql-13 

Uninstall postgresql-13 And Its Dependencies

To uninstall postgresql-13 and its dependencies that are no longer needed by Kali Linux, we can use the command below:

sudo apt-get -y autoremove postgresql-13 

Remove postgresql-13 Configurations and Data

To remove postgresql-13 configuration and data from Kali Linux we can use the following command:

sudo apt-get -y purge postgresql-13 

Remove postgresql-13 configuration, data, and all of its dependencies

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

sudo apt-get -y autoremove --purge postgresql-13 

References

Summary

In this tutorial we learn how to install postgresql-13 using different package management tools like apt, apt-get and aptitude.

Источник

PostgreSQL в Kali Linux

Начать знакомство с администрирования PostgreSQL рекомендуется с « PostgreSQL в Linux: рецепты популярных действий и решения проблем ». Там уже собраны актуальные инструкции для частых задач и, самое главное, частые ошибки и как их исправить.

Перевод опфициальной документации от авторов PostgreSQL на русском вы найдёте в разделе Настройка баз данных PostgreSQL из статьи «Настройка и запуск сетевых служб в Kali Linux (Apache, MySQL, SSH, PostgreSQL, NetworkManager и Bluetooth)»

Обновление PostgreSQL в Kali Linux

При обновлении пакетов в Kali Linux было показано следующее сообщение:

Configuring postgresql-common Obsolete major version 13 The PostgreSQL version 13 is obsolete, but the server or client packages are still installed. Please install the latest packages (postgresql-14 and postgresql-client-14) and upgrade the existing clusters with pg_upgradecluster (see manpage). Please be aware that the installation of postgresql-14 will automatically create a default cluster 14/main. If you want to upgrade the 13/main cluster, you need to remove the already existing 14 cluster (pg_dropcluster --stop 14 main, see manpage for details). The old server and client packages are no longer supported. After the existing clusters are upgraded, the postgresql-13 and postgresql-client-13 packages should be removed. Please see /usr/share/doc/postgresql-common/README.Debian.gz for details.

Всё в лучших традициях официальных предупреждений: читайте справку и что-то делайте.

По факту после данного обновления мы имеем в системе 2 установленные версии PostgreSQL:

Читайте также:  Boot menu кали линукс

Если запустить службу PostgreSQL командой:

sudo systemctl start postgresql

И проверить версию командой:

sudo -u postgres psql postgres -c 'SELECT version()' | grep PostgreSQL

То будет выведено следующее:

PostgreSQL 13.4 (Debian 13.4-3) on x86_64-pc-linux-gnu, compiled by gcc (Debian 10.3.0-8) 10.3.0, 64-bit

То есть по умолчанию используется 13, устаревшая версия.

Удаление старых версий пакетов, например, командой:

sudo apt remove postgresql-13 postgresql-client-13

ситуацию не меняет. Если вам нужно перенести базы данных из устаревшей версии в новую, то верните устаревшие пакеты, если вы успели их удалить.

Последующие действия подразумевают, что вы

1) установили новую версию PostgreSQL, но ещё не использовали её, то есть не сохраняли базы данных, поскольку файлы новой версии будут удалены.

2) хотите перенести старые база данных в новый формат

С помощью следующей команды просмотрите доступные кластеры:

На скриншоте только один из них online (я успел удалить пакет postgresql-13), но у вас оба должны быть online, иначе перенос базы данных не удастся.

Пример правильного вывода:

Ver Cluster Port Status Owner Data directory Log file 13 main 5432 online postgres /var/lib/postgresql/13/main /var/log/postgresql/postgresql-13-main.log 14 main 5433 online postgres /var/lib/postgresql/14/main /var/log/postgresql/postgresql-14-main.log

Как можно увидеть, обе версии 13 и 14 в настоящее время установлены и запущены. Держите в уме, что при переносе старой базы данных в новый формат вам понадобиться двойной объём места на диске, поскольку pg_upgradecluster копирует данные.

Процедура обновления включает в себя следующее:

1. Удаляем данные новой версии:

sudo pg_dropcluster --stop 14 main

2. Запускаем процедуру обновления кластера:

sudo pg_upgradecluster 13 main

3. Когда операция будет завершена, дважды проверьте, что всё работает

sudo pg_dropcluster --stop 13 main

Это показывает суть обновления кластера. Конечно, в конкретной вашей ситуации могут быть нюансы: другие номера версий, либо другое расположение файлов с базами данных.

sudo -u postgres pg_upgrade -b /opt/pgsql-13/bin -B /usr/bin -d /var/lib/postgres/olddata -D /var/lib/postgres/data

Теперь используется 14, то есть самая последняя версия.

Источник

PostgreSQL 14 Kali Installation – Step-by-step

GNU/Linux Kali Install PostgreSQL 14 – Quick-Start Guide

Hi! The Tutorial shows you Step-by-Step How to Install PostgreSQL 14 in Kali GNU/Linux Desktop.

And PostgreSQL 14 for Kali is a Powerful, Open Source Object-Relational Database System with a proven Architecture knows for its strong Reliability, Data Integrity, and Correctness.

Auto Draft

1. Launching Terminal

Open Terminal

Contents

Showing Ads here is the best solution I found for not embarassing somebody about participating in a #%$Foundation^.

«When the Last Tree has been cut down, the Last Fish caught, the Last River poisoned, only then will we realize that One Cannot Eat Money.»

«No usable Computer exists today with completely Open Software and Hardware (as much as some companies want to Market themselves as such).»

Follow Us

The GNU/Linux Free Software Phylosophy

GNU/Linux Logo

Steve Jobs’ Last Words

Steve Jobs Last Words in the Darkness

«Being a Winner in a Free Computing OS Mission means to adopt a Commercial like Strategy. Transcending Duality in Oneness and so dispensing both Free and Non Free Software. Cause evangelizing Freedom in a Non Free World is like keeping a Trojan Horse. Hallelujah!»

Читайте также:  Cinnamon extensions linux mint

«Using the Money just for buying Stuff and Not Supporting the Free Gift Philosophy is a sign of a Selfish and Narrow Mind.»

What can Save the World from a Blind and Quick Self-destruction.
The Immediate and Humble Mass Conversion to the Spiritual Way!
Because Earth & Nature has been Ravaged without Pity by the Wild and Selfish mass Competition to Win and Shown that U’re someone Better because you got a Lot of fla$hY Power$$$.

«Taking care if somebody is liking, following, or buying is just a serious hidrance on the priceless Way of Creative Freedom.»

Credits

Ganesha

Everlasting Glory to God, Jesus Christ, The Holy Spirit, Ganesha, Shiva, Vishnu, Krisna, Laozi, Buddha, Bodhidharma, Ma Gcig, Hakuin, Ikkyu, Nagarjuna, Tilopa, Naropa, Milarepa, Suhrawardi, St Dismas, St Francesco, St Teresa, St John, St Filippo, Eckehart. All The Holy Divinities, Avatars, Saints, Mystics, and True Spiritual Masters. Because they are in the Eternal Light of Truth & Delight Enlightening a World of Darkness, Nescience, Blindness, Uneasiness and Falsehood!

Источник

How to install PostgreSQL on Kali Linux

In this article, we will see how to install PostgreSQL on Kali Linux step by step. In this article, we will perform below steps:
1. Install PostgreSQL on Kali Linux.
2. PostgreSQL post installation steps(Enable, start the PostgreSQL service).
3. Connect to PostgreSQL server on Kali Linux.

Install PostgreSQL on Kali Linux

1. Go to PostgreSQL official website. There we can find the commands to be performed to install PostgreSQL on Kali Linux distribution.

Note: Kali Linux is debian type family ditribution.

2. Create the file repository configuration:

sudo sh -c 'echo "deb http://apt.postgresql.org/pub/repos/apt $(lsb_release -cs)-pgdg main" > /etc/apt/sources.list.d/pgdg.list'

How to install PostgreSQL on Kali Linux

3. Import the repository signing key:

wget --quiet -O - https://www.postgresql.org/media/keys/ACCC4CF8.asc | sudo apt-key add -

4. Update the package lists:

5. Install the latest version of PostgreSQL 14. If we want to install older version, assume 12, then replace postgresql-14 with postgresql-12 in the below command.

sudo apt-get -y install postgresql-14

We have successfully installed PostgreSQL on Kali Linux. Now, check the status of PostgreSQL, start it and connect to PostgreSQL server on Kali Linux.

PostgreSQL post installation steps on Kali Linux

1. Verify PostgreSQL status on Kali Linux.

sudo systemctl status postgresql

2. Enable the PostgreSQL service on Kali Linux.

sudo systemctl enable postgresql

3. Start the PostgreSQL server on Kali Linux.

sudo systemctl start postgresql

Connect to PostgreSQL on Kali Linux

1. Switch to postgres user by running below command.

2. Run the command psql from terminal.

3. We can get verify the PostgreSQL version installed on Kali Linux by running below command.

4. We can verify list of databases installed by default with PostgreSQL server by running below command.

5. We can create database by running below command.

create database r2schools;

So in this article, we have performed PostgreSQL installation, started and connected to PostgreSQL on Kali Linux.

Источник

Оцените статью
Adblock
detector