5.2. Install PostgreSQL on Linux

发布时间 :2025-10-25 12:30:51 UTC      

Open the PostgreSQL website https://www.postgresql.org/ and click on the menu bar Download You can see that there are installation packages for many platforms, including Linux, Windows, Mac OS, and so on.

For Linux, we can see that various platforms such as Ubuntu and Red Hat are supported. Click the specific platform link to view the installation method:

Image0

Click in the image above file browser We can also download the latest source code for PostgreSQL.

Image1

This chapter takes Ubuntu as an example.

5.2.1. Ubuntu install PostgreSQL

Ubuntu can install PostgreSQL using apt-get:

sudo apt-get update
sudo apt-get install postgresql postgresql-client

After installation, the system creates a database superuser postgres with an empty password.

#  sudo -i -u postgres

At this point, use the following command to enter postgres and output the following information, indicating that the installation is successful:

~$ psql
psql (9.5.17)
Type "help" for help.

postgres=#

Exit the PostgreSQL prompt by entering the following command:

\q

The PostgreSQL installation is started by default, but the service can also be started manually in the following ways.

sudo /etc/init.d/postgresql start   # 开启
sudo /etc/init.d/postgresql stop    # 关闭
sudo /etc/init.d/postgresql restart # 重启
Principles, Technologies, and Methods of Geographic Information Systems  102

In recent years, Geographic Information Systems (GIS) have undergone rapid development in both theoretical and practical dimensions. GIS has been widely applied for modeling and decision-making support across various fields such as urban management, regional planning, and environmental remediation, establishing geographic information as a vital component of the information era. The introduction of the “Digital Earth” concept has further accelerated the advancement of GIS, which serves as its technical foundation. Concurrently, scholars have been dedicated to theoretical research in areas like spatial cognition, spatial data uncertainty, and the formalization of spatial relationships. This reflects the dual nature of GIS as both an applied technology and an academic discipline, with the two aspects forming a mutually reinforcing cycle of progress.