Building local mirrors of the EDB repositories
Suggest editsThe following 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
using the following command
Setup the enterprisedb repository on the server as per the instructions in Getting started with CLI.
Once configured you can check the existence of the repository using dnf repolist
The output looks similar to:
With the successful setup of the repository that we want to mirror, we can now use dnf reposync
to copy the repository to a local directory. There are a number of useful options that can be passed to dnf reposync
:
--repoid
- This is the repository id which can be found in thednf repolist
output.--download-metadata
- This bypasses the step of having to runcreaterepo
.--arch
- You can filter the downloads based on a specified architecture.--remote-time
- This will attempt to maintain the timestamp on the packages.--newest-only
- Only download the newest versions of the packages in the repository.--download-path
- Specify the path to download the files to.
Here is an example in the use of dnf reposync
. In this example, we are going to serve the repository usign the apache server (httpd
) and use the download path of
/var/www/html/repos/{repoid}
where {repoid}
matches the repository id we are cloning.
So the command would be:
You should now see files in /var/www/html/repos/enterprisedb-enterprise
if this command is successful. By default, SELinux blocks access to these files. To enable httpd to access these files, you can use either run httpd
in permissive mode or change the SELinux context of the files. To change the SELinux context of the files, use the following command:
To set httpd to permissive mode, use the following command:
You can now use a browser to view the directory. Using the terminal browser lynx
(dnf install lynx
), you can run:
And you will see the contents of the directory in the browser.
To view the web server from another system, you may need to open port 80 on the firewall.
Check that the firewall is running.
Then open the port.
Then reload the firewall to apply the changes,.
You are now able to 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 the example shown below:
Now 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 packages available from the locally managed yum repository, and you can use this repository like any other yum repository.
Maintaining the locally managed repository
The locally managed repository needs relatively light maintenance, however, you should configure some mechanism to keep the locally managed yum repository up to date, 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!