问题原文
原帖链接 · salamflamo · CC BY-SA 4.0
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.
- I download
postgresql10with all depedencies usingyumdownloaderfrom my development server - I upload all
rpmfiles into server B - I start to install with command
rpm -ivh *.rpminside server B - After I try that so many
depedenciessare not downloaded byyumdownloader
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
已采纳解答
原帖链接 · Chris Maes · CC BY-SA 4.0
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,}
摘自公开归档,保留原文语言,版式经整理,外部媒体与邮箱地址已移除。
