Установка postgresql kali linux

How To Install postgresql-server-dev-13 on Kali Linux

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

What is postgresql-server-dev-13

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 ways to install postgresql-server-dev-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.

Install postgresql-server-dev-13 Using apt-get

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

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

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

Install postgresql-server-dev-13 Using apt

Update apt database with apt using the following command.

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

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

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

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

How To Uninstall postgresql-server-dev-13 on Kali Linux

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

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

Uninstall postgresql-server-dev-13 And Its Dependencies

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

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

Remove postgresql-server-dev-13 Configurations and Data

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

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

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

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

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

References

Summary

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

Читайте также:  Linux all users desktop

Источник

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.

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.

Читайте также:  Red hat linux adding users

Источник

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:

Если запустить службу 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, то есть самая последняя версия.

Читайте также:  Linux remove dns cache

Источник

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.

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.

Источник

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