How to get recursively dependencies for package with versions? [on hold]


How to get recursively dependencies for package with versions? [on hold]



I need to install a package on a system without internet access (the package contains a driver for network card).



System A has internet connection and runs Ubuntu 14; System B has no internet connection and runs Ubuntu 16.



How can I download all dependencies recursively with the correct version on system A, that could be next installed on system B?



This question appears to be off-topic. The users who voted to close gave this specific reason:





Stack Overflow is a site for programming and development questions. This question appears to be off-topic because it is not about programming or development. See What topics can I ask about here in the Help Center. Perhaps Super User or Unix & Linux Stack Exchange would be a better place to ask.
– jww
Jun 29 at 18:54




2 Answers
2



I would suggest that you run a docker container (or some type of virtualization) with Ubuntu 16.04 on System A. After that, you can update the packages index (apt update) then install the desired packages on that system. Finally, you may copy the packages index from /var/lib/apt, and the packages themselves from /var/cache/apt/archives to System B.


apt update


/var/lib/apt


/var/cache/apt/archives





Yet better, he may simply save the whole Docker container as an image file and run that image on the offline host. Containers have been found exactly for such cases to avoid dependency hell.
– Mohammed Noureldin
Jun 29 at 18:49






@MohammedNoureldin but he needs to install docker on System B in the first place.
– Abdullatif Eymash
Jun 29 at 18:57





@Abdullatif Eymash I used apt-get --download-only inside virtualbox with image of system B, then i copied apt cache to real system B and installed packages by dpkg. Problem solved THX
– cptYossarian
Jun 29 at 20:08



It's a good practice to restrict hosts from internet access. However, as a patch management solution, you should setup a local mirror - this will centralize your patching needs for the entire organization. It's not just limited to ubuntu but you could host multiple linux distro mirrors. The only thing you really need is a large capacity disk, maybe mirror it for some non-critical resiliency. This will also cut-back on a multi-server environment using bandwidth, limiting the bandwidth to a single host pulling updates to it's mirror one-time. Just make sure you have a process or script to run to regularly check for updates. That way your hosts are ready for patching when you need it, assuming you stay on top of emerging threats and vulnerability management for various *Nix platforms.



I'm not a huge fan of reinventing the wheel so.. here's a couple how-to references.



What you're going to have to do afterwards is change your /etc/apt/sources.list to point to your new internal repository for aptitude repos. You can just copy the lines existing there, change the server domain name to your local server. Then you don't need any of your linux hosts to communicate to any hosts outside of your network, the one server pulling from the mirrors can. It will definitely help you refine your security needs.



For RHEL based or yum, it's configured in /etc/yum.repos.d/{reponame}.repo

Comments

Popular posts from this blog

paramiko-expect timeout is happening after executing the command

Export result set on Dbeaver to CSV

Opening a url is failing in Swift