2

I have two server,then these servers need to install postgresql10 , server A could install postgresql10 using yum install , but server B has a rule that is not allowed to connect the internet. So I trying to install with rpm file in server B.

  1. I download postgresql10 with all depedencies using yumdownloader from my development server
  2. I upload all rpm files into server B
  3. I start to install with command rpm -ivh *.rpm inside server B
  4. After I try that so many depedenciess are not downloaded by yumdownloader

My idea is make a file that contain the package and all depedencies in single file, like tar.gz file then I install to other server as simple as extract file but I still research, then still stuck on it.

So if you has a story same as me, what best way did you have? Is there any script that could help my problem. Please share with me, Thank you very much

1 Answer 1

2

There is a way, but it is quite tricky and might mess up your servers, so be very careful.

Nomenclature:

  • online : your system that is connected to the repositories
  • offline: your system that is not connected

Steps:

Compress your rpm database from the offline system and transfer it to the online system:

cd /var/lib/rpm/
tar -cvzf /tmp/rpmdb.tgz *
scp /tmp/rpmdb.tgz root@online:/tmp

on your online system; replace your rpm db with the one from the offline system:

cp -r /var/lib/rpm{,.bak} # back up your rpmdb from your online system. Make sure not to lose this!!
rm -rf /var/lib/rpm/*
cd /var/lib/rpm
tar -xvf /tmp/rpmdb.tgz # now your online system pretends to have the rpm database from the offline system. Don't start really installing / uninstalling rpms or you'll break everything

now simulate your update with download-only:

yum install --downloadonly # or
zypper up --download-only

Now you can fetch all the downloaded packages and they should suffice for updating your offline system

And now restore your online machine:

rm -rf /var/lib/rpm
cp -r /var/lib/rpm{.bak,}
1
  • After this, we can use yum install $package --downloadonly or yumdownloader --resolve $package , then move depedencies into server without internet connection
    – salamflamo
    Jul 22, 2019 at 8:23

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .