You are not logged in.

#1 2012-07-16 22:22:31

Duca
Member
Registered: 2009-01-12
Posts: 23

repac - a tool to back up ALL your installed packages

Guys, i would like to share a tool i developed mostly as an exercise. It's name is repac and it somewhat overlaps bacman but it allows you to back up all your installed packages into individual tar bziped files and is multithreaded.

The code is hosted at bitbucket

The code can be run either on python3 or python2 and using any number of threads*

./repac.py  options
and currently the options are
-p  complete path (example /home/user/packages)
-n  int  (number of threads to use)
-v  verbose mode
-h help message

* it can be a bit stressfull to one's hard disk if -n is set to a high number of threads (consider high n> 6)
[further notes]
For now you dont have the option to backup anything but the whole installation and the code is poorly commented (although most of it should be straight forward).

Constructive criticism, patches and comments are welcome.

Last edited by Duca (2012-07-18 00:27:04)

Offline

#2 2012-07-17 17:34:11

jwele
Member
Registered: 2012-07-03
Posts: 62

Re: repac - a tool to back up ALL your installed packages

That sounds fantastic, kind of arch spin maker of sorts. Can it also do a net install of all packages or does it manually copy the installed binaries off your computer?

Offline

#3 2012-07-17 19:16:05

Duca
Member
Registered: 2009-01-12
Posts: 23

Re: repac - a tool to back up ALL your installed packages

Not sure if i understood your question, but here's my try

it generate .pkg.tar.bz2 off of your installed packages. The easiest way of reinstalling  them is to run repo-make inside the destination directory to create a repository from it. Like
> repo-make reponame *.bz2

Add it to your /etc/pacman.conf
[reponame]
Server = file:///path/repo

And install.

It would be nice to generate a list of installed packages so one could easily reinstall them all by name without having to guess what were installed precisely. Perhaps the script could also run repo-make as well.

Offline

#4 2012-07-17 19:29:02

jwele
Member
Registered: 2012-07-03
Posts: 62

Re: repac - a tool to back up ALL your installed packages

Ah that makes sense. How cool.

Offline

#5 2012-07-17 19:41:49

Duca
Member
Registered: 2009-01-12
Posts: 23

Re: repac - a tool to back up ALL your installed packages

Thanks jwele. Please try it out if you have the time

Offline

#6 2012-07-17 19:45:23

jwele
Member
Registered: 2012-07-03
Posts: 62

Re: repac - a tool to back up ALL your installed packages

Will do, I was about to make the switch from debian to arch on my laptop and use all apps from my desktop arch install so this would be the ideal tool.

Offline

#7 2012-07-17 19:48:50

Duca
Member
Registered: 2009-01-12
Posts: 23

Re: repac - a tool to back up ALL your installed packages

Lol nice timing

Offline

#8 2012-07-17 19:57:39

jwele
Member
Registered: 2012-07-03
Posts: 62

Re: repac - a tool to back up ALL your installed packages

I was thinking of making a similar tool as well but one that identifies installed packages and saves that list so that when you build new arch systems it will download the most up to date packages instead of you manually having to check the front page news for what fixes are needed. So that way you could essentially use that and this tool to make arch spins.

Offline

#9 2012-07-17 20:07:52

jwele
Member
Registered: 2012-07-03
Posts: 62

Re: repac - a tool to back up ALL your installed packages

I could almost guarantee I would be reinventing the wheel but what the hell.

Offline

#10 2012-07-17 20:08:40

progandy
Member
Registered: 2012-05-17
Posts: 5,280

Re: repac - a tool to back up ALL your installed packages

jwele wrote:

I was thinking of making a similar tool as well but one that identifies installed packages and saves that list so that when you build new arch systems it will download the most up to date packages instead of you manually having to check the front page news for what fixes are needed. So that way you could essentially use that and this tool to make arch spins.

If you only want a list, pacman -Qqe is your friend wink On your new installation feed that list to pacman -S.

(pacman -Qqe ; pacman -Qqem) | sort | uniq -u > packages.list
pacman -Sy --needed --recursive `cat packages.list` 

| alias CUTF='LANG=en_XX.UTF-8@POSIX ' |

Offline

#11 2012-07-17 20:10:43

jwele
Member
Registered: 2012-07-03
Posts: 62

Re: repac - a tool to back up ALL your installed packages

progandy wrote:
jwele wrote:

I was thinking of making a similar tool as well but one that identifies installed packages and saves that list so that when you build new arch systems it will download the most up to date packages instead of you manually having to check the front page news for what fixes are needed. So that way you could essentially use that and this tool to make arch spins.

If you only want a list, pacman -Qqe is your friend wink On your new installation feed that list to pacman -S.

(pacman -Qqe ; pacman -Qqem) | sort | uniq -u > packages.list
pacman -Sy --needed --recursive `cat packages.list` 

Thanks for saving me some man page reading, that is exactly what I'm looking for. smile

Offline

#12 2012-07-17 20:15:02

Duca
Member
Registered: 2009-01-12
Posts: 23

Re: repac - a tool to back up ALL your installed packages

that's some nice info.

Offline

Board footer

Powered by FluxBB