View previous topic :: View next topic |
Author |
Message |
sdz n00b

Joined: 26 Sep 2011 Posts: 38
|
Posted: Sun Mar 26, 2017 7:38 pm Post subject: Query Installed Packages on Archived Installation |
|
|
I recently reinstalled Gentoo on a new HDD (same computer otherwise).
I have the old hard drive mounted in a USB 3.0 enclosure to /mnt/old/.
How can I query that partition to get the list of all installed packages (including versions and USE flags)? |
|
Back to top |
|
 |
eccerr0r Watchman

Joined: 01 Jul 2004 Posts: 10012 Location: almost Mile High in the USA
|
Posted: Sun Mar 26, 2017 8:04 pm Post subject: |
|
|
If that disk is complete and secure, you can chroot to it and run
After getting the list you can
Code: | # equery uses packagename |
to get its USE flags, if you didn't have a good record in its /etc{/portage}/make.conf or /etc/portage/* ... _________________ Intel Core i7 2700K/Radeon R7 250/24GB DDR3/256GB SSD
What am I supposed watching? |
|
Back to top |
|
 |
fedeliallalinea Administrator


Joined: 08 Mar 2003 Posts: 31610 Location: here
|
Posted: Mon Mar 27, 2017 5:43 am Post subject: |
|
|
Also command qlist -vI work _________________ Questions are guaranteed in life; Answers aren't. |
|
Back to top |
|
 |
freke Veteran

Joined: 23 Jan 2003 Posts: 1075 Location: Somewhere in Denmark
|
Posted: Mon Mar 27, 2017 1:13 pm Post subject: |
|
|
Code: | cd /mnt/old/var/db/pkg/ && ls -d */* |
[edit]no use-flags here though[/edit] |
|
Back to top |
|
 |
cboldt Veteran


Joined: 24 Aug 2005 Posts: 1046
|
Posted: Mon Mar 27, 2017 2:00 pm Post subject: |
|
|
Code: | cd /mnt/old/var/db/pkg
for i in $(ls -d */*)
do
printf "%-30s %s\n" $i "$(cat $i/USE)"
done |
There are some entries in the USE file that are repetitive and could be filtered out, but you get the idea here.
Only a fraction of "all installed packages" belongs in the "world" file, and the list of USEflags doesn't differentiate between default USEflags, and those that need to be set. |
|
Back to top |
|
 |
khayyam Watchman


Joined: 07 Jun 2012 Posts: 6227 Location: Room 101
|
Posted: Mon Mar 27, 2017 2:04 pm Post subject: |
|
|
sdz ...
not done this but I expect you can set the root env var (for most query tools, including emerge) ...
Code: | % emerge --root=/mnt/old --pretend --verbose --quiet --emptytree --deep @world |
That said, providing both the package list and useflags isn't something gentoolkit, portage-utils, eix, etc, do, so it might be easier to script using /var/db/pkg ...
Code: | % pushd /mnt/old/var/db/pkg ; for p in */* ; do echo "$p" $(cat "${p}/USE") ; done ; popd |
As per fedeliallalinea suggestion, you could add the '--root' env (though this is just a package list, not package and useflags) ...
Code: | % qlist --root /mnt/old -Iv |
HTH & best ... khay |
|
Back to top |
|
 |
|