Installing PostgreSQL 9.5.15 on CentOS 6: A Step-by-Step Guide

Installing PostgreSQL 9.5.15 on CentOS 6

Installing PostgreSQL 9.5.15 on a CentOS 6 system can be a bit tricky, especially when trying to find the correct package. In this article, we will walk through the process of installing PostgreSQL 9.5.15 using yum and provide some guidance on how to troubleshoot common issues.

Table of Contents

  1. Introduction
  2. Error 404 Not Found
  3. Troubleshooting
  4. Installing PostgreSQL 9.5.15 using yum
  5. Additional Configuration

Introduction

PostgreSQL is a powerful and popular open-source relational database management system. The pgdg-centos96-9.6-3.noarch.rpm package is available on the official PostgreSQL yum repository, which provides a convenient way to install PostgreSQL 9.5.15 on CentOS 6.

However, when we try to install this package using the command rpm -Uvh https://download.postgresql.org/pub/repos/yum/9.6/redhat/rhel-6-x86_64/pgdg-centos96-9.6-3.noarch.rpm, we get an error message: “Error 404 Not Found”.

Error 404 Not Found

The error message “Error 404 Not Found” indicates that the package is not available on the specified repository. This can be caused by several factors, such as:

  • The package is no longer available on the official PostgreSQL yum repository.
  • The package is available on a different repository.
  • The repository is not configured correctly.

To troubleshoot this issue, we need to check the error message and verify that the package is indeed not found on the specified repository.

Troubleshooting

Let’s try to install the pgdg-centos96-9.6-3.noarch.rpm package using the following command:

rpm -Uvh https://download.postgresql.org/pub/repos/yum/9.6/redhat/rhel-6-x86_64/pgdg-centos96-9.6-3.noarch.rpm;

If this command fails, we can try to install the package using a different method.

Installing PostgreSQL 9.5.15 using yum

Instead of installing the pgdg-centos96-9.6-3.noarch.rpm package, we can use the following command to install PostgreSQL 9.5.15:

yum install https://download.postgresql.org/pub/repos/yum/reporpms/EL-6-x86_64/pgdg-redhat-repo-latest.noarch.rpm

Alternatively, we can use the yum install postgresql96 command to install PostgreSQL 9.5.15:

yum install postgresql96

Additional Configuration

Once we have installed PostgreSQL 9.5.15 using yum, we need to configure it correctly.

By default, the installation process creates a new user and a new database named postgres. However, in this case, we are trying to install PostgreSQL 9.5.15, which is an older version.

To ensure that our installation works correctly, we need to verify that the package was installed successfully and that there are no errors during startup.

We can do this by checking the PostgreSQL logs using the following command:

tail -f /var/log/postgresql.log

If everything goes well, we should see a message indicating that PostgreSQL has started correctly.

Conclusion

Installing PostgreSQL 9.5.15 on CentOS 6 can be challenging due to issues with package availability and configuration. However, by using the correct installation method and troubleshooting techniques, we can ensure that our installation works correctly.

In this article, we have walked through the process of installing PostgreSQL 9.5.15 using yum and provided guidance on how to troubleshoot common issues. We hope that this information will be helpful in solving similar problems in the future.

Code Snippets

Here are some code snippets that can help you install PostgreSQL 9.5.15:

# Install the pgdg-centos96-9.6-3.noarch.rpm package
rpm -Uvh https://download.postgresql.org/pub/repos/yum/9.6/redhat/rhel-6-x86_64/pgdg-centos96-9.6-3.noarch.rpm;

# Install PostgreSQL 9.5.15 using yum
yum install https://download.postgresql.org/pub/repos/yum/reporpms/EL-6-x86_64/pgdg-redhat-repo-latest.noarch.rpm

# Install PostgreSQL 9.5.15 using yum
yum install postgresql96
# Check the PostgreSQL logs
tail -f /var/log/postgresql.log

By following these code snippets and tips, you should be able to install PostgreSQL 9.5.15 correctly on your CentOS 6 system.

Troubleshooting Tips

Here are some troubleshooting tips that can help you resolve common issues during the installation process:

  • Make sure that the package is available on the official PostgreSQL yum repository.
  • Check that the repository is configured correctly and that the package is not corrupted.
  • Use the yum install command with the -y flag to automatically accept the license agreement.

By following these troubleshooting tips, you should be able to resolve common issues during the installation process and ensure a successful installation of PostgreSQL 9.5.15 on your CentOS 6 system.


Last modified on 2024-05-17