Question How do I install packages in multiple Linux computers ?

Status
Not open for further replies.

alfredjoejr

Commendable
Nov 9, 2021
25
0
1,530
I've installed a very large sized package through "sudo apt-get install ...... " on my primary computer but I need to install those packages on my other computers too.
I don't want to re-download the files as they're extremely large.
Also, It's irritating to do "sudo apt-get update " in every machine. It takes time and my bandwidth too !

Is there any way to do this ?
 
D

Deleted member 14196

Guest
Not to my knowledge. It is what it is

Search for some automated Linux management tools. And that’ll probably be even more complicated than doing it manually because you’re gonna have to learn how to do it
 
Set up a local repository and sync your systems to that. You're still going to have to download massive quantities to keep it in sync with the master, and, you will be responsible for its upkeep. You're going to need a wide pipe and lots of storage. For fewer than 10 systems, checking only once a week, it's not worth the effort.

You can script the entire update process and run it on a schedule. But there are valid reasons it's not done that way by default.
 
  • Like
Reactions: Grobe
I've installed a very large sized package through "sudo apt-get install ...... " on my primary computer but I need to install those packages on my other computers too.
I don't want to re-download the files as they're extremely large.
Also, It's irritating to do "sudo apt-get update " in every machine. It takes time and my bandwidth too !

Is there any way to do this ?

Automating configuration in Linux can be done well with Ansible. You will need SSH access to those boxes. You declare groups of hosts then apply the playbook (config script) to the groups. Here's a sample of how a 'copy file' step looks:

Code:
- name: Ansible Copy Example Local to Remote

  hosts: remoteserver (name of the host group)

  tasks:

    - name: copying file with playbook

      become: true  (escalate privileges)

      copy:

        src: ~/Downloads/index.html

        dest: /var/www/html

        owner: apache  (this and the below entries refer to the file being created in destination)

        group: apache

        mode: 0644

You could then script the install commands in the following steps. Ansible has means to check if a step was already done, so if you setup your playbook properly you will be able to run it without fear of applying to hosts that were already configured (it will check each configuration item and validate that it's already correct, than skip it). File copies will go through SSH. If you are in a LAN with local access to those boxes, it will do what you want (avoid downloading from the internet again). If you are over VPN it will probably be best to serve the file from a LAN location.
 
  • Like
Reactions: TuxRuffian
Jul 23, 2022
19
4
15
The problem is that Ansible is very slow because it is programmed in Python. A simple loop in Ansible takes almost 400 times longer than if you do a loop via the Almquist Shell. So it's best to just write a script in the Almquist shell if you want something that requires much less energy to do the same.
 
Status
Not open for further replies.