DEV Community

Doğukan Eren for OpenLAB

Posted on

NEXUS OSS Create PostgreSQL Repository using Apt Proxy

Using Nexus OSS, you can create, manage, and publish your own repositories. Additionally, you can utilize the "apt proxy" feature to publish existing repository content from your server.

You can access our article on the installation of Nexus OSS from here.
You can also access our article on creating an apt repository on Nexus OSS from here.

Let's proceed with creating the Postgresql repository on Nexus OSS.

1- Log in to the Nexus OSS interface with an authorized user

After the installation, the default admin user is available, and you can find its password by using the following command:

cat /opt/sonatype/sonatype-work/nexus3/admin.password
Enter fullscreen mode Exit fullscreen mode

2- Creating a Repository

a- Let's go to the "Repository" page under the "Settings" section.

b- After that, click on the "Repositories" tab under "Repository," and on the opened page, click the "Create Repository" button.

Image description

Let's proceed by selecting the "apt proxy" option from the opened page.

Image description

3- Let's configure our Postgresql Repository.

Let's enter the address of the Postgresql repository as shown below in the Remote repository field:

http://apt.postgresql.org/pub/repos/apt/

Image description

4- Let's save it.

Image description

You can save it by clicking on the Create Repository button located at the bottom.

Image description

When we navigate to the "Repositories" page, we will see the newly added repository listed. By clicking on the "Copy" button, we can access our newly created Postgresql repository on our server.

Image description

When we visit the relevant URL, the repository will appear in front of us.

Image description

Optional

Adding the new repository to Linux client machines.

If your client machine is Ubuntu 22, you can run the following command:

echo "deb [trusted=yes] http://192.168.122.100:8081/repository/hosted-postgresql-hdd/ jammy-pgdg main" > /etc/apt/sources.list.d/nexus.list
Enter fullscreen mode Exit fullscreen mode

Note: If not, you can proceed by customizing the jammy-pgdg part to match your own version.

You can check if it is working by running the apt update command.

Top comments (0)