You are not logged in.

#1 2017-01-08 14:52:38

thomas_stringer
Member
From: In the Ocean somewhere...
Registered: 2016-12-13
Posts: 46
Website

[SOLVED] Saving pacman installed packages to a file..?

The desire here is to save a list of installed packages to a file, for version-controlling and rebuilding purposes. So in other words, if I had to reinstall (or install on another machine) and I want to proactively install all packages from another machine, what's the best approach here?

I know I could do

pacman -Q > packages.txt

to dump the installed packages to a flat file, but my questions are these:

1. Is there a way to then subsequently install all packages on an Arch installation from the same flat file? I.e. on a 2nd machine install all of these packages listed
2. Does this include AUR packages?

The reason I ask is because in the Python world we do something like

pip freeze > requirements.txt

and then we are able to subsequently

pip install -r requirements.txt

to get the same packages. Is there a similar/same workflow for Arch packages (and hopefully AUR packages)?

Last question, I'm sure this is a "no" but I version-control as much as possible and usually store it all on GitHub (publicly). Is there any sensitive nature to the output of

pacman -Q

?

Thank you in advance!

Last edited by thomas_stringer (2017-01-08 15:55:26)

Offline

#2 2017-01-08 14:59:42

Trilby
Inspector Parrot
Registered: 2011-11-29
Posts: 29,523
Website

Re: [SOLVED] Saving pacman installed packages to a file..?


"UNIX is simple and coherent..." - Dennis Ritchie, "GNU's Not UNIX" -  Richard Stallman

Offline

#3 2017-01-08 15:03:08

thomas_stringer
Member
From: In the Ocean somewhere...
Registered: 2016-12-13
Posts: 46
Website

Re: [SOLVED] Saving pacman installed packages to a file..?

Perfect, exactly what I'm looking for. I guess you can't automate the install of AUR packages, is that right? Is there any way to do that, or is that a manual operation?

Any sensitive information in that output, or is it pretty save to vc that publicly?

Offline

#4 2017-01-08 15:14:11

Trilby
Inspector Parrot
Registered: 2011-11-29
Posts: 29,523
Website

Re: [SOLVED] Saving pacman installed packages to a file..?

If you use a local repo of built AUR packages, you could copy the pkg.tar.xz files over and just install those along with everything in the list in a single pacman command.  But short of that there is no good way of automating the install of several AUR packages.

There are countless bad approaches floating around.  But really there's virtually nothing to it.  You can get a list of your local packages (which should mostly be AUR packages) with `pacman -Qm`.  Then just build each of those on the new system.  You could even just write 4 or 5 lines of bash that would read that list file, git clone each, and makepkg for each.  That's all it takes to reinstall them all.


"UNIX is simple and coherent..." - Dennis Ritchie, "GNU's Not UNIX" -  Richard Stallman

Offline

#5 2017-01-08 15:48:32

thomas_stringer
Member
From: In the Ocean somewhere...
Registered: 2016-12-13
Posts: 46
Website

Re: [SOLVED] Saving pacman installed packages to a file..?

Trilby wrote:

If you use a local repo of built AUR packages, you could copy the pkg.tar.xz files over and just install those along with everything in the list in a single pacman command.  But short of that there is no good way of automating the install of several AUR packages.

There are countless bad approaches floating around.  But really there's virtually nothing to it.  You can get a list of your local packages (which should mostly be AUR packages) with `pacman -Qm`.  Then just build each of those on the new system.  You could even just write 4 or 5 lines of bash that would read that list file, git clone each, and makepkg for each.  That's all it takes to reinstall them all.

Perfect! Thanks! And a package list isn't sensitive by nature, right? Could be public safely?

Offline

#6 2017-01-08 15:53:22

Trilby
Inspector Parrot
Registered: 2011-11-29
Posts: 29,523
Website

Re: [SOLVED] Saving pacman installed packages to a file..?

Nothng sensitive.  All the content is just a subset of what is readily available in the repos.  People would see which tools you use ... worst case they might give you a hard time for using terminal emulator A while they prefer terminal emulator B.


"UNIX is simple and coherent..." - Dennis Ritchie, "GNU's Not UNIX" -  Richard Stallman

Offline

#7 2017-01-08 15:55:15

thomas_stringer
Member
From: In the Ocean somewhere...
Registered: 2016-12-13
Posts: 46
Website

Re: [SOLVED] Saving pacman installed packages to a file..?

Trilby wrote:

Nothng sensitive.  All the content is just a subset of what is readily available in the repos.  People would see which tools you use ... worst case they might give you a hard time for using terminal emulator A while they prefer terminal emulator B.

Awesome! Thanks so much yet again for your help, Trilby. This is much appreciated.

Offline

Board footer

Powered by FluxBB