[arch-general] Best way to clone install (package selection to another box?)
Listmates: If I want to clone my package selection to another box, is there a better way to do it other than just parsing the files in /var/cache/pacman/pkg to generate a list to feed to pacman after install on the second box? Something like: for i in $(find /var/cache/pacman/pkg/ -type f); do TMP=${i##*/} FILE=${TMP%%-[[:digit:]]*} echo $FILE >> ~/linux/INSTALLED done Then after install on the new box: pacman --sync --refresh pacman --sync $( < ~/linux/INSTALLED) --or-- while read file; do pacman --sync $file done < ~/linux/INSTALLED I've picked around a bit and can't find a pacman option that is somewhat the equivalent to rsync's '--files-from' that would allow me to read the list to pass to pacman directly from a file. I don't know if pacman can do something like this or how many files it can handle at once if the list of files is piped or redirected to it. I don't think the second while loop would work either from a dependency perspective, and, the repeated calls to pacman would make it slow as hell. What's the current thinking on the best way to do something like this? -- David C. Rankin, J.D.,P.E. Rankin Law Firm, PLLC 510 Ochiltree Street Nacogdoches, Texas 75961 Telephone: (936) 715-9333 Facsimile: (936) 715-9339 www.rankinlawfirm.com
box1: pacman -Qet | awk '{print $1}' >> INSTALLED box 2: (first copy files from /var/cache/pacman/pkg in box1 to box2 and also INSTALLED file) pacman -S $(cat installed) On Wed, Apr 22, 2009 at 1:51 PM, David C. Rankin <drankinatty@suddenlinkmail.com> wrote:
Listmates:
If I want to clone my package selection to another box, is there a better way to do it other than just parsing the files in /var/cache/pacman/pkg to generate a list to feed to pacman after install on the second box? Something like:
for i in $(find /var/cache/pacman/pkg/ -type f); do TMP=${i##*/} FILE=${TMP%%-[[:digit:]]*} echo $FILE >> ~/linux/INSTALLED done
Then after install on the new box:
pacman --sync --refresh
pacman --sync $( < ~/linux/INSTALLED)
--or--
while read file; do pacman --sync $file done < ~/linux/INSTALLED
I've picked around a bit and can't find a pacman option that is somewhat the equivalent to rsync's '--files-from' that would allow me to read the list to pass to pacman directly from a file. I don't know if pacman can do something like this or how many files it can handle at once if the list of files is piped or redirected to it. I don't think the second while loop would work either from a dependency perspective, and, the repeated calls to pacman would make it slow as hell.
What's the current thinking on the best way to do something like this?
-- David C. Rankin, J.D.,P.E. Rankin Law Firm, PLLC 510 Ochiltree Street Nacogdoches, Texas 75961 Telephone: (936) 715-9333 Facsimile: (936) 715-9339 www.rankinlawfirm.com
Am Mittwoch, 22. April 2009 07:02:36 schrieb Juan Diego:
pacman -Qet | awk '{print $1}' >> INSTALLED
or just pacman -Qqet > INSTALLED -- Pierre Schmitz Clemens-August-Straße 76 53115 Bonn Telefon 0228 9716608 Mobil 0160 95269831 Jabber pierre@jabber.archlinux.de WWW http://www.archlinux.de
David C. Rankin wrote:
Listmates:
If I want to clone my package selection to another box, is there a better way to do it other than just parsing the files in /var/cache/pacman/pkg to generate a list to feed to pacman after install on the second box? Something like:
for i in $(find /var/cache/pacman/pkg/ -type f); do TMP=${i##*/} FILE=${TMP%%-[[:digit:]]*} echo $FILE >> ~/linux/INSTALLED done
Then after install on the new box:
pacman --sync --refresh
pacman --sync $( < ~/linux/INSTALLED)
--or--
while read file; do pacman --sync $file done < ~/linux/INSTALLED
I've picked around a bit and can't find a pacman option that is somewhat the equivalent to rsync's '--files-from' that would allow me to read the list to pass to pacman directly from a file. I don't know if pacman can do something like this or how many files it can handle at once if the list of files is piped or redirected to it. I don't think the second while loop would work either from a dependency perspective, and, the repeated calls to pacman would make it slow as hell.
What's the current thinking on the best way to do something like this?
If you're looking for something simple, I have a script in the AUR called Packup that allows you to backup and restore installed packages.
Juan Diego wrote: box1: pacman -Qet | awk '{print $1}' >> INSTALLED box 2: (first copy files from /var/cache/pacman/pkg in box1 to box2 and also INSTALLED file) pacman -S $(cat installed) Pierre Schmitz wrote: or just pacman -Qqet > INSTALLED Daniel J Griffiths wrote:
If you're looking for something simple, I have a script in the AUR called Packup that allows you to backup and restore installed packages.
Juan, Pierre & Daniel, That is the next best thing since sliced bread. Thank you all. Beats having to roll-your-own any day. Looking at: usage: pacman {-Q --query} [options] [package] -e, --explicit list all packages explicitly installed -q, --quiet show less information for query and search -t, --unrequired list all packages not required by any package it makes sense now, but I wouldn't have put those pieces together without help;-) But, I got close! (even a blind squirrel finds a nut every once in a while): for i in $(find /var/cache/pacman/pkg/ -type f); do TMP=${i##*/} FILE=${TMP%%-[[:digit:]]*} echo $FILE >> ~/linux/INSTALLED done creates the equivalent of "pacman -Qqet > INSTALLED" (although not in one swipe), and "pacman --sync $( < ~/linux/INSTALLED)" would have gotten the rest. The big missing piece of the puzzle was rsyncing the files from box1 -> box2 instead of requiring a complete re-download of the files. I like it! Thanks again! The info has been duly saved to my basket notepads archive and will be handy as soon as I get my little kde problem sorted. (PS, I found /etc/rc.d/kdm3, so I'm getting warmer) -- David C. Rankin, J.D.,P.E. Rankin Law Firm, PLLC 510 Ochiltree Street Nacogdoches, Texas 75961 Telephone: (936) 715-9333 Facsimile: (936) 715-9339 www.rankinlawfirm.com
Funny enough, I did think of copying my packages over when I was trying to clone a machine. But then I realized my target machine was x86_64 and my main machine was x86 :} Oh well. -AT On Wed, Apr 22, 2009 at 12:57 AM, David C. Rankin <drankinatty@suddenlinkmail.com> wrote:
Juan Diego wrote: box1:
pacman -Qet | awk '{print $1}' >> INSTALLED
box 2:
(first copy files from /var/cache/pacman/pkg in box1 to box2 and also INSTALLED file) pacman -S $(cat installed)
Pierre Schmitz wrote:
or just pacman -Qqet > INSTALLED
Daniel J Griffiths wrote:
If you're looking for something simple, I have a script in the AUR called Packup that allows you to backup and restore installed packages.
Juan, Pierre & Daniel,
That is the next best thing since sliced bread. Thank you all. Beats having to roll-your-own any day. Looking at:
usage: pacman {-Q --query} [options] [package] -e, --explicit list all packages explicitly installed -q, --quiet show less information for query and search -t, --unrequired list all packages not required by any package
it makes sense now, but I wouldn't have put those pieces together without help;-) But, I got close! (even a blind squirrel finds a nut every once in a while):
for i in $(find /var/cache/pacman/pkg/ -type f); do TMP=${i##*/} FILE=${TMP%%-[[:digit:]]*} echo $FILE >> ~/linux/INSTALLED done
creates the equivalent of "pacman -Qqet > INSTALLED" (although not in one swipe), and "pacman --sync $( < ~/linux/INSTALLED)" would have gotten the rest. The big missing piece of the puzzle was rsyncing the files from box1 -> box2 instead of requiring a complete re-download of the files. I like it! Thanks again!
The info has been duly saved to my basket notepads archive and will be handy as soon as I get my little kde problem sorted. (PS, I found /etc/rc.d/kdm3, so I'm getting warmer)
-- David C. Rankin, J.D.,P.E. Rankin Law Firm, PLLC 510 Ochiltree Street Nacogdoches, Texas 75961 Telephone: (936) 715-9333 Facsimile: (936) 715-9339 www.rankinlawfirm.com
David C. Rankin wrote:
Listmates:
If I want to clone my package selection to another box, is there a better way to do it other than just parsing the files in /var/cache/pacman/pkg to generate a list to feed to pacman after install on the second box?
One option is to have the first box serve as an Arch package mirror for the rest of the boxes. i.e., box #1's mirrorlist file points to an external Arch mirror, box #'s 2 through n's mirrorlist files point to box #1. It's perhaps slightly more complicated to implement, but not onerously so, and probably more elegant than any other solution - especially if there's multiple servers involved. I don't recall what you have to do to make an Arch mirror, but it's not that complicated, IIRC. There's probably something on the Arch wiki about it. HTH, DR
David C. Rankin wrote:
Listmates:
If I want to clone my package selection to another box, is there a better way to do it other than just parsing the files in /var/cache/pacman/pkg to generate a list to feed to pacman after install on the second box?
One option is to have the first box serve as an Arch package mirror for the rest of the boxes. i.e., box #1's mirrorlist file points to an external Arch mirror, box #'s 2 through n's mirrorlist files point to box #1.
It's perhaps slightly more complicated to implement, but not onerously so, and probably more elegant than any other solution - especially if there's multiple servers involved.
I don't recall what you have to do to make an Arch mirror, but it's not that complicated, IIRC. There's probably something on the Arch wiki about it. make a directory, put packages in it, run repo-add (in the repo, not
On Wed, 22 Apr 2009 10:23:14 -0400 David Rosenstrauch <darose@darose.net> wrote: the client) that's it afaik. Dieter
HTH,
DR
David Rosenstrauch wrote:
David C. Rankin wrote:
If I want to clone my package selection to another box, is there a better way to do it other than just parsing the files in /var/cache/pacman/pkg to generate a list to feed to pacman after install on the second box?
One option is to have the first box serve as an Arch package mirror for the rest of the boxes. i.e., box #1's mirrorlist file points to an external Arch mirror, box #'s 2 through n's mirrorlist files point to box #1.
I've implemented 2 ways of caching packages in my LAN for saving bandwidth: One, by running a squid on a box, with a cache_dir size of around 1 GB and a maximum_object_size large enough to accommodate huge packages like openoffice. The rest of my archboxen use the squid box as a proxy (note: the mirrorlist servers order needs to be the same everywhere). This way, if a package is downloaded once, it will be cached for the rest to download at speeds over 6 MB/s :-) The downside is that I end up having the same packages occupying disk space in many places and if I neglect to update a machine for some time, the packages expire from the squid cache. Two, by mounting the /var/cache/pacman/pkg directory of the masterbox with sshfs at the local /var/cache/pacman/pkg before pacman install operations. Pacman happily finds most packages already in place and only downloads the ones missing. Method number two is mirrorlist/proxy agnostic and has become my favorite, especially since I've started using the powerpill/aria2 combination. -- ##### # ##### ####### ##### # ##### "I find your lack of faith disturbing."
participants (8)
-
Andrei Thorp
-
Christos Nouskas
-
Daniel J Griffiths
-
David C. Rankin
-
David Rosenstrauch
-
Dieter Plaetinck
-
Juan Diego
-
Pierre Schmitz