Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

How should I install dependencies when the machine does not have yum #2339

Closed
1053531172 opened this issue Apr 23, 2024 · 4 comments
Closed
Assignees
Labels

Comments

@1053531172
Copy link

Please provide the following information when submitting an issue (feature requests or general comments can skip this):

  1. pgBackRest version: 2.4.7

  2. PostgreSQL version:12

  3. Operating system/version - if you have more than one server (for example, a database server, a repository host server, one or more standbys), please specify each: centos7

  4. Did you install pgBackRest from source or from a package?
    source

  5. Describe the issue:
    How should I install dependencies when the machine does not have yum?I tried using rpm to install dependencies, but it is not easy to use

@dwsteele dwsteele self-assigned this Apr 23, 2024
@dwsteele
Copy link
Member

You are right, rpm is not easy to use. You should be able to download all the dependencies and install them using rpm but we don't any instructions for that.

If you do figure it out, please post the results here so others can benefit. Thanks!

@1053531172
Copy link
Author

1053531172 commented Apr 24, 2024

You are right, rpm is not easy to use. You should be able to download all the dependencies and install them using rpm but we don't any instructions for that.

If you do figure it out, please post the results here so others can benefit. Thanks!

I did this by creating a Centos7 system using a virtual machine and changing the /etc/yum.conf configuration as follows

[main]
#cachedir=/var/cache/yum/$basearch/$releasever
cachedir=/app/yum
keepcache=1
debuglevel=2
logfile=/var/log/yum.log
exactarch=1
obsoletes=1
gpgcheck=1
plugins=1
installonly_limit=5
bugtracker_url=http://bugs.centos.org/set_project.php?project_id=23&ref=http://bugs.centos.org/bug_report_page.php?category=yum
distroverpkg=centos-release

Cache the dependencies downloaded through yum in a folder, and then download the dependencies using the following command
sudo yum install -y bzip2-devel libssh2-devel libxml2-devel libyaml-devel libzstd-devel lz4-devel openssl-devel postgresql postgresql-devel postgresql-libs zstd lz4

Finally, upload the cached rpm dependencies to the target machine and force the installation of dependencies on the target machine through rpm
sudo rpm -ihv --force depend/*

@pgstef
Copy link
Member

pgstef commented Apr 24, 2024

On RHEL systems, the downloadonly plugin is pretty handy too. But indeed, if your target server doesn't have repo access, you'll need another server with the same characteristics to download the packages to be able to install them later somewhere else offline.

It probably could have been a good question for the pgsql-pkg-yum mailing list (even though RHEL 7 is EOL for PGDG yum repos).

Not receiving new updates on the server would make me uncomfortable from a stability and security point of view. If you don't want your production servers to have internet access to those repos, maybe it would worth having a repo mirror inside your local network to control what you can update more easily 🤔

@1053531172
Copy link
Author

On RHEL systems, the downloadonly plugin is pretty handy too. But indeed, if your target server doesn't have repo access, you'll need another server with the same characteristics to download the packages to be able to install them later somewhere else offline.

It probably could have been a good question for the pgsql-pkg-yum mailing list (even though RHEL 7 is EOL for PGDG yum repos).

Not receiving new updates on the server would make me uncomfortable from a stability and security point of view. If you don't want your production servers to have internet access to those repos, maybe it would worth having a repo mirror inside your local network to control what you can update more easily 🤔

Yes, for security, my server cannot connect to the Internet. I will update the image regularly to upgrade related plug-ins. However, my scenario is not just that, some servers do not use the images I create. Therefore, I need a method that can solve the above two scenarios. When compiling PostgreSQL, I will compile it on the server where the relevant plugins exist, so that the installation package of PostgreSQL has the required plugins. I have tried compiling pgbackrest using the same method, but it did not work.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

3 participants