You are not logged in.
Hi, actually I have a modified Arch Linux distro for using in many workstations in a company, also the company has its own repository with all the packages installed in the workstations.
Pacman in every workstation just uses the repository owned by the company, no official arch repositories, this is for preventing installing not authorized packages from official arch repositories. When pacman -Syu it synchronizes with own repository database and keep installed packages up to date.
Is there any way for installing new packages added to repository remotely to every workstation??
I mean, suppose that the company writes its own new package new_company_package-1.1-any.pkg.tar.xz and add it to its own repositories and update data base correctly...
What can be done for getting this new package installed automatically in all the workstations??
Offline
The only thing I can think of is a cron job on all workstations that runs a script that you create to install the new packages or, alternatively, do nothing if there are no new packages you want installed.
Offline
Automatically installing packages is likely to cause problems in many cases, but if you completely control the repository then you should be able to manage this.
Here are some ideas:
Simple Script
If you do not care about installation reasons (explicit vs implicit, i.e. as a dependency), then you can run the following (e.g. in a cronjob) to ensure that all packages in the repo are installed on each computer:
pacman -Syu
pacman -S --noconfirm $(pacman -T $(pacman -Sql <your repo>))
Explanation: "pacman -Sql <your repo>" will list every package in the repo. Pass that list to "pacman -T" will return a list of missing package, which are then passed to "pacman -S" for installation.
If you do care about installation reasons then it gets a little trickier. One solution would be to create two separate repos. One would hold packages to explicitly install and the other would hold dependencies. Then you could just use the former in the script above.
SSH Script
Install SSH with authentication keys on each computer if you haven't already, and then run a script that installs the package on each computer after it is added to the repo. This would preserve installation reasons and, if you check exit status, alert you to any problems that arise while installing the new package.
Another Script
You could also create a script that retrieves a package list from some central server periodically and then installs new packages on that list (as well as removing old packages no longer on the list).
#!/bin/sh
# Get explicit list from server.
curl http://xxx.xxx.xxx.xxxx:yyyyy/<path to list of packages> | sort > server.txt
# Get local explicit list.
pacman -Qqe | sort > local.txt
# Install missing packages.
pacman -S --noconfirm --asexplicit $(comm -23 server.txt local.txt)
# Mark packages not listed by the server as implicitly installed.
pacman -D --asdeps $(comm -13 server.txt local.txt)
# Remove orphaned dependencies.
pacman -Rsn $(pacman -Qqdt)
Last edited by Xyne (2012-11-05 18:05:10)
My Arch Linux Stuff • Forum Etiquette • Community Ethos - Arch is not for everyone
Offline