![]() ![]() In this guide, we have demonstrated the step-by-step instructions to install, use, and remove the PostgreSQL database on Ubuntu 22.04. To use the PostgreSQL database, provide the default login credential “ $ sudo -u postgres psql”. Then, install PostgreSQL by utilizing the “ $ sudo apt install postgresql-client postgresql -y” command. To install PostgreSQL on Ubuntu 22.04, import the GPG key, and add the repository of PostgreSQL database into the system. We have demonstrated the procedure to install, use, and remove PostgreSQL database on Ubuntu 22.04. Utilize the following command to remove the directory of PostgreSQL: sudo rm -rf /etc/postgresql/ Hit the “ Yes” option:īelow displayed output indicates that PostgreSQL is removed successfully from Ubuntu 22.04: Meanwhile, the “ Package Configuration” wizard will prompt you to confirm the removal of the PostgreSQL database. To remove the PostgreSQL database from Ubuntu 22.04, execute this command: sudo apt-get -purge remove postgresql postgresql-* Want to remove the PostgreSQL database from Ubuntu 22.04? Have a look at the following section! PostgreSQL Database removal from Ubuntu 22.04 Then, type “ exit” to quit from the PostgreSQL shell: # exit ![]() In the next step, grant privileges of database to the new user: # grant all privileges on database itslinuxfoss to itslinux Now, create a new user, and specify the username and password in the below-mentioned command: # create user itslinux with encrypted password 'root' We have created “ itslinuxfoss” PostgreSQL database: # create database itslinuxfoss Make a new database and specify its name. Run the following command to log in to PostgreSQL on Ubuntu 22.04: $ sudo -i -u postgresĮxecute “ psql” to get the interactive interface of PostgreSQL: $ psqlĪlternatively, you can run the below command for the same purpose: $ sudo -u postgres psql On Ubuntu 22.04, utilize the provided instructions to set up the PostgreSQL database. Install PostgreSQL in Ubuntu The following command should list all the packages associated with your PostgreSQL installation. PostgreSQL Database set up on Ubuntu 22.04 Step 1: Install PostgreSQL Step 2: PostgreSQL Roles and Databases Step 3: Set up a Role Step 4: Build a Database Step 5: Open a New Prompt Step 6: Table. We have successfully installed the PostgreSQL database on Ubuntu 22.04. In order to start PostgreSQL services, use the mentioned command: $ sudo systemctl start postgresql Let’s move ahead to start the PostgreSQL service. Install PostgreSQL on Ubuntu 22.04 with the provided command: $ sudo apt install postgresql-client postgresql -yĬheck the service status of PostgreSQL on Ubuntu 22.04: $ systemctl status postgresql In the next step, add the PostgreSQL repository into the system: $ echo deb jammy-pgdg main | sudo tee /etc/apt//postgresql.listĪgain, update the system packages: $ sudo apt update Install additional dependencies on Ubuntu 22.04: $ sudo apt install software-properties-common apt-transport-https wget -yĪfter that, import the GPG key of PostgreSQL by utilizing the below command: $ sudo wget -O- | gpg -dearmor | sudo tee /usr/share/keyrings/postgresql.gpg Open up the terminal using “ CTRL+ALT+T” and update and upgrade the system packages: $ sudo apt update & sudo apt upgrade -y On Ubuntu 22.04, to install the PostgreSQL database, follow the steps given below. PostgreSQL Database installation on Ubuntu 22.04 The following post will describe how to install, use, and uninstall PostgreSQL in Ubuntu 22.04. PostgreSQL is a more executable, reliable, and secure database management system. It supports Structure Query Language and provides modern features such as updatable views, transactional integrity, multi-version concurrency management, applied keys, and queries. Please see /usr/share/doc/postgresql-common/ for details.PostgreSQL is a free, open-source, and powerful object-relational database. The old server and client packages are no longer supported.Īfter the existing clusters are upgraded, the postgresql-12 and postgresql-client-12 packages should be removed. ![]() If you want to upgrade the 12/main cluster, you need to remove the already existing 13 cluster ( pg_dropcluster -stop 13 main, see manpage for details). Please be aware that the installation of postgresql-13 will automatically create a default cluster 13/main. Please install the latest packages ( postgresql-13 and postgresql-client-13) and upgrade the existing clusters with pg_upgradecluster (see manpage). The PostgreSQL version 12 is obsolete, but the server or client packages are still installed. Upgrade PostgreSQL ¶ĭuring Ubuntu updgrade to 21.04 you receive this message “Configuring postgresql-common”: ![]() This article is aimed at those like me who use Ubuntu and PostgreSQL to develop locally on their computer and after the last update to Ubuntu 21.04 they have two versions of PostgreSQL installed. ![]()
0 Comments
Leave a Reply. |
AuthorWrite something about yourself. No need to be fancy, just an overview. ArchivesCategories |