0

We are using Ubuntu machines for our LAN networks. To install some packages for every machine, we use the Ubuntu package manager apt. Let's say about installing git for every machine. Instead of installing git from the internet for every machine, I want to keep our own package manager in one of our machines as a repository. From that repository, I will install the packages for every other machine. I hope there will be a tool exist for this job in Linux. I want to know what are the tools used for doing this job in Linux?

1

You have 3 choices - I recommend #2, #1 will work mostly, #3 for only a couple of machines.

Use a proxy that will cache the deb files as they are requested. First machine gets from internet, others get from cache. The program apt-cacher-ng can do this for you. https://www.tecmint.com/apt-cache-server-in-ubuntu/

The second option is to set up a webserver and mirror the distribution repository in some fashion. Depending on what your upstream provides (ftp, http, rsync, etc) how you do this is somewhat up in the air. I chose to mirror over http/https using debmirror and some shell scripts, and then I serve the directory up with a basic Apache install with a properly set DOCUMENT_ROOT directive.

A third option and one I wouldn't really recommend (esp with more than a couple of machines to update) is to share the /var/cache/apt/archives directory from the "master source" machine to the others via network (samba/cifs, nfs, sshfs, etc) and then after the first machine updates/installs the others should see the file as already downloaded, assuming they also mount hte share at /var/cache/apt/archives. If you do this though you have to be careful of using the apt-get clean command.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.