How to proxy our private Yum and Apt repositories

Anna Bellandi
Anna Bellandi
  • Updated

This article describes in general terms how to proxy a EDB private repository. In particular, how to get the correct URL to add to the Sonatype Nexus third-party repository management solution, and how to use the Nexus Proxy repository to install software.

Configure Nexus

Let's suppose we would like to proxy the postgres_extended CloudSmith repository.

For Yum Repository

  1. Go to the Nexus repository manager web interface.

  2. Navigate to the repositories section and click on Create Repository.

  3. Choose the yum(proxy) option.

  4. Fill in the required information:

  • Name: postgres-extended-proxy
  • Remote storage URL: https://downloads.enterprisedb.com/<CS_COMPANY_TOKEN>/postgres_extended/
  • Replace <CS_COMPANY_TOKEN with> your CloudSmith company token.
  1. Pic a Blob store for Storage.

  2. Click Save to create the repository.

For Apt repository

(Let's suppose we would like to proxy Ubuntu Jammy)

  1. Go to the Nexus repository manager web interface.

  2. Navigate to the repositories section and click on Create Repository.

  3. Choose the apt(proxy) option.

  4. Fill in the required information:

  • Name: postgres-extended-proxy-ubuntu
  • Remote storage URL: https://downloads.enterprisedb.com/<CS_COMPANY_TOKEN>/postgres_extended/deb/ubuntu
  • Replace <CS_COMPANY_TOKEN with> your CloudSmith company token
  • Define the Distribution (e.g., jammy)
  1. Pic a Blob store for Storage.

  2. Click Save to create the repository.

Once the repository is created, Nexus will start to proxy the postgres_extended repository, and you can configure your VMs to access it as described in the following section.

Configure VM for accessing Nexus Proxy repository

To configure your VM to access the Nexus proxy Yum and Apt repositories, follow these steps:

For Yum Repository

  1. Retrieve the GPG key for the CloudSmith repository:
wget -O /etc/pki/rpm-gpg/RPM-GPG-KEY-postgres-extended https://downloads.enterprisedb.com/<CS_COMPANY_TOKEN>/postgres_extended/gpg.B283E3B654B42B8E.key

Replace <CS_COMPANY_TOKEN> with your CloudSmith company token.

  1. Create a new .repo file under /etc/yum.repo.d/ with the below content:
# cat /etc/yum.repo.d/nexus-postgres-extended.repo
[postgres-extended-nexus]
name=PG Extended Nexus Repository
baseurl=https://<NEXUS_CREDENTIALS>@<NEXUS_HOST>/repository/postgres-extended-2/rpm/rocky/$releasever/$basearch/
enabled=1
gpgcheck=1
gpgkey=/etc/pki/rpm-gpg/RPM-GPG-KEY-postgres-extended

Replace <NEXUS_CREDENTIALS> with your Nexus credentials in the format username:password, and <NEXUS_HOST> with the hostname of your Nexus server.

For Apt Repository

  1. Retrieve the GPG key for the CloudSmith repository:
curl -1sLf 'https://downloads.enterprisedb.com/<CS_COMPANY_TOKEN>/postgres_extended/gpg.B283E3B654B42B8E.key' |  gpg --dearmor >> /usr/share/keyrings/postgres-extended-keyring.gpg

Replace <CS_COMPANY_TOKEN> with your CloudSmith company token.

  1. Create a new .list file under /etc/apt/source.list.d/ with the following content:
# cat /etc/apt/sources.list.d/postgres-extended.list
deb [signed-by=/usr/share/keyrings/postgres-extended-keyring.gpg] https://<NEXUS_CREDENTIALS>@<NEXUS_HOST>/repository/postgres-extended-ubuntu jammy main

Replace <NEXUS_CREDENTIALS> with your Nexus credentials in the format username:password, and <NEXUS_HOST> with the hostname of your Nexus server.

Was this article helpful?

0 out of 0 found this helpful