From 83c2797722ae21c2dd9515214903f540f7483324 Mon Sep 17 00:00:00 2001 From: Christoph Berg Date: Tue, 16 Apr 2024 12:42:31 +0200 Subject: [PATCH] Modernize the Debian and Ubuntu download pages Mention apt.postgresql.org.sh first. Use `deb [signed-by=key]` instead of apt-key. Also sync the pages for minimal diff. --- templates/pages/download/linux/debian.html | 79 ++++++++++++++-------- templates/pages/download/linux/ubuntu.html | 76 +++++++++++++-------- 2 files changed, 98 insertions(+), 57 deletions(-) diff --git a/templates/pages/download/linux/debian.html b/templates/pages/download/linux/debian.html index a866e0b6..919c5c92 100644 --- a/templates/pages/download/linux/debian.html +++ b/templates/pages/download/linux/debian.html @@ -7,13 +7,22 @@

Linux downloads (Debian)

-PostgreSQL is available in all Debian versions by default. However, the -stable versions of Debians "snapshot" a specific version of PostgreSQL -that is then supported throughout the lifetime of that Debian version. -The PostgreSQL project also maintains an apt repository with all supported +PostgreSQL is available in all Debian versions by default. However, Debian +"snapshots" a specific version of PostgreSQL that is then supported throughout +the lifetime of that Debian version. +The PostgreSQL project maintains an Apt repository with all supported of PostgreSQL available.

+

Included in Distribution

+

+Debian includes PostgreSQL by default. To install PostgreSQL on Debian, +use the apt (or other apt-driving) command: +

+
+apt install postgresql
+
+

PostgreSQL Apt Repository

@@ -24,8 +33,7 @@ updates for all supported versions of PostgreSQL throughout the support lifetime of PostgreSQL.

-The PostgreSQL apt repository supports the currently supported stable -versions of Debian: +The PostgreSQL Apt repository supports the current versions of Debian:

-

on the following architectures:

+

+on the following architectures: +

+

-To use the apt repository, follow these steps: +Automated repository configuration:

-
# Create the file repository configuration:
-sudo sh -c 'echo "deb https://apt.postgresql.org/pub/repos/apt $(lsb_release -cs)-pgdg main" > /etc/apt/sources.list.d/pgdg.list'
+    
sudo apt install -y postgresql-common
+sudo /usr/share/postgresql-common/pgdg/apt.postgresql.org.sh
+ +
-# Import the repository signing key: -wget --quiet -O - https://www.postgresql.org/media/keys/ACCC4CF8.asc | sudo apt-key add - +

+To manually configure the Apt repository, follow these steps: +

+ +
+
# Import the repository signing key:
+sudo apt install curl ca-certificates
+sudo install -d /usr/share/postgresql-common/pgdg
+sudo curl -o /usr/share/postgresql-common/pgdg/apt.postgresql.org.asc --fail https://www.postgresql.org/media/keys/ACCC4CF8.asc
+
+# Create the repository configuration file:
+sudo sh -c 'echo "deb [signed-by=/usr/share/postgresql-common/pgdg/apt.postgresql.org.asc] https://apt.postgresql.org/pub/repos/apt $(lsb_release -cs)-pgdg main" > /etc/apt/sources.list.d/pgdg.list'
 
 # Update the package lists:
-sudo apt-get update
+sudo apt update
 
-# Install the latest version of PostgreSQL.
-# If you want a specific version, use 'postgresql-12' or similar instead of 'postgresql':
-sudo apt-get -y install postgresql
+# Install the latest version of PostgreSQL: +# If you want a specific version, use 'postgresql-16' or similar instead of 'postgresql' +sudo apt -y install postgresql

For more information about the apt repository, including answers to frequent -questions, please see the apt page on -the wiki. +questions, please see the +PostgreSQL Apt Repository wiki page.

-

Included in distribution

-

-Debian includes PostgreSQL by default. To install PostgreSQL on -Debian, use the apt-get (or other apt-driving) command: -

-
-  apt-get install postgresql-12
-
+

Packages

The repository contains many different packages including third party addons. The most common and important packages are (substitute the @@ -82,19 +99,23 @@ version number as required): - + - + + + + + - + diff --git a/templates/pages/download/linux/ubuntu.html b/templates/pages/download/linux/ubuntu.html index 620f73a2..f721ba30 100644 --- a/templates/pages/download/linux/ubuntu.html +++ b/templates/pages/download/linux/ubuntu.html @@ -7,13 +7,23 @@

Linux downloads (Ubuntu)

-PostgreSQL is available in all Ubuntu versions by default. However, -Ubuntu "snapshots" a specific version of PostgreSQL that is then -supported throughout the lifetime of that Ubuntu version. Other -versions of PostgreSQL are available through the PostgreSQL apt -repository. +PostgreSQL is available in all Ubuntu versions by default. However, Ubuntu +"snapshots" a specific version of PostgreSQL that is then supported throughout +the lifetime of that Ubuntu version. +The PostgreSQL project maintains an Apt repository with all supported +of PostgreSQL available.

+

Included in Distribution

+

+Ubuntu includes PostgreSQL by default. To install PostgreSQL on Ubuntu, +use the apt (or other apt-driving) command: +

+
+apt install postgresql
+
+ +

PostgreSQL Apt Repository

If the version included in your version of Ubuntu is not the one you want, @@ -26,8 +36,8 @@ updates for all supported versions of PostgreSQL throughout the support The PostgreSQL Apt Repository supports the current versions of Ubuntu:

@@ -38,42 +48,48 @@ on the following architectures:
  • amd64
  • arm64 (LTS releases only)
  • ppc64el (LTS releases only)
  • +
  • s390x (LTS releases only)
  • -To use the apt repository, follow these steps: +Automated repository configuration: +

    + +
    +
    sudo apt install -y postgresql-common
    +sudo /usr/share/postgresql-common/pgdg/apt.postgresql.org.sh
    + +
    + +

    +To manually configure the Apt repository, follow these steps:

    -
    # Create the file repository configuration:
    -sudo sh -c 'echo "deb https://apt.postgresql.org/pub/repos/apt $(lsb_release -cs)-pgdg main" > /etc/apt/sources.list.d/pgdg.list'
    +    
    # Import the repository signing key:
    +sudo apt install curl ca-certificates
    +sudo install -d /usr/share/postgresql-common/pgdg
    +sudo curl -o /usr/share/postgresql-common/pgdg/apt.postgresql.org.asc --fail https://www.postgresql.org/media/keys/ACCC4CF8.asc
     
    -# Import the repository signing key:
    -wget --quiet -O - https://www.postgresql.org/media/keys/ACCC4CF8.asc | sudo apt-key add -
    +# Create the repository configuration file:
    +sudo sh -c 'echo "deb [signed-by=/usr/share/postgresql-common/pgdg/apt.postgresql.org.asc] https://apt.postgresql.org/pub/repos/apt $(lsb_release -cs)-pgdg main" > /etc/apt/sources.list.d/pgdg.list'
     
     # Update the package lists:
    -sudo apt-get update
    +sudo apt update
     
    -# Install the latest version of PostgreSQL.
    -# If you want a specific version, use 'postgresql-12' or similar instead of 'postgresql':
    -sudo apt-get -y install postgresql
    +# Install the latest version of PostgreSQL: +# If you want a specific version, use 'postgresql-16' or similar instead of 'postgresql' +sudo apt -y install postgresql

    For more information about the apt repository, including answers to frequent -questions, please see the PostgreSQL Apt Repository page on -the wiki. +questions, please see the +PostgreSQL Apt Repository wiki page.

    -

    Included in distribution

    -

    -Ubuntu includes PostgreSQL by default. To install PostgreSQL on -Ubuntu, use the apt-get (or other apt-driving) command: -

    - -apt-get install postgresql-12 - +

    Packages

    The repository contains many different packages including third party addons. The most common and important packages are (substitute the @@ -82,19 +98,23 @@ version number as required):

    postgresql-client-12postgresql-client-16 client libraries and client binaries
    postgresql-12postgresql-16 core database server
    postgresql-doc-16documentation
    libpq-dev libraries and headers for C language frontend development
    postgresql-server-dev-12postgresql-server-dev-16 libraries and headers for C language backend development
    - + - + + + + + - + -- 2.39.5
    postgresql-client-12postgresql-client-16 client libraries and client binaries
    postgresql-12postgresql-16 core database server
    postgresql-doc-16documentation
    libpq-dev libraries and headers for C language frontend development
    postgresql-server-dev-12postgresql-server-dev-16 libraries and headers for C language backend development