Building local mirrors of the EDB repositories
Suggest editsThese instructions are for yum-based systems, such as RHEL, AlmaLinux, Rocky Linux, and other RPM packaged systems.
Create the local yum repository
Install the packages yum-utils
and createrepo
:
Set up the enterprisedb repository on the server using the instructions in Getting started using repositories with the CLI.
Once the repository is configured, you can check the existence of the repository using dnf repolist
.
The output looks similar to:
After the successful setup of the repository that you want to mirror, you can use dnf reposync
to copy the repository to a local directory. You can pass a number of useful options to dnf reposync
:
--repoid
— The repository id that can be found in thednf repolist
output.--download-metadata
— Bypass the step of having to runcreaterepo
.--arch
— Filter the downloads based on a specified architecture.--remote-time
— Attempt to maintain the timestamp on the packages.--newest-only
— Download only the newest versions of the packages in the repository.--download-path
— Specify the path to download the files to.
This example shows the use of dnf reposync
. This example serves the repository usign
on the apache server (httpd
). It uses the download path of /var/www/html/repos/<repoid>
, where <repoid>
matches the repository id you're cloning.
After the command completes successfully, there are files in /var/www/html/repos/enterprisedb-enterprise
. By default, SELinux blocks access to these files. To enable httpd to access these files, you can either run httpd
in permissive mode or change the SELinux context of the files.
To change the SELinux context of the files:
To set httpd to permissive mode:
You can now use a browser to view the directory. Using the terminal browser lynx
(dnf install lynx
), you can run:
The contents of the directory appear in the browser.
Viewing the web server from another system
To view the web server from another system, you might need to open port 80 on the firewall.
To do so, first check that the firewall is running:
Then open the port:
To apply the changes, reload the firewall:
You can now access the web server from other systems, enabling its use as a mirror.
Using the locally managed yum repository
To enable another host to install from the local mirror, you need to create a yum repository file in /etc/yum.repos.d/edb_local.repo
. The contents can be as simple as this example:
To test that the packages are available from the local server, use dnf repo-pkgs {repoid} list
:
As you can see, the packages available are the ones available from the locally managed yum repository. You can use this repository like any other yum repository.
Maintaining the locally managed repository
The locally managed repository needs relatively light maintenance. However, we recommend that you configure some mechanism to keep the locally managed yum repository up to date. The easiest option is to create a cron job that runs the relevant dnf reposync
command.
Could this page be better? Report a problem or suggest an addition!