Gentoo Forums
Gentoo Forums
Gentoo Forums
Quick Search: in
Query Installed Packages on Archived Installation
View unanswered posts
View posts from last 24 hours

 
Reply to topic    Gentoo Forums Forum Index Portage & Programming
View previous topic :: View next topic  
Author Message
sdz
n00b
n00b


Joined: 26 Sep 2011
Posts: 33

PostPosted: Sun Mar 26, 2017 7:38 pm    Post subject: Query Installed Packages on Archived Installation Reply with quote

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
View user's profile Send private message
eccerr0r
Watchman
Watchman


Joined: 01 Jul 2004
Posts: 9678
Location: almost Mile High in the USA

PostPosted: Sun Mar 26, 2017 8:04 pm    Post subject: Reply with quote

If that disk is complete and secure, you can chroot to it and run

Code:
# equery list \*


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
View user's profile Send private message
fedeliallalinea
Administrator
Administrator


Joined: 08 Mar 2003
Posts: 30904
Location: here

PostPosted: Mon Mar 27, 2017 5:43 am    Post subject: Reply with quote

Also command qlist -vI work
_________________
Questions are guaranteed in life; Answers aren't.
Back to top
View user's profile Send private message
freke
l33t
l33t


Joined: 23 Jan 2003
Posts: 977
Location: Somewhere in Denmark

PostPosted: Mon Mar 27, 2017 1:13 pm    Post subject: Reply with quote

Code:
cd /mnt/old/var/db/pkg/ && ls -d */*


[edit]no use-flags here though[/edit]
Back to top
View user's profile Send private message
cboldt
Veteran
Veteran


Joined: 24 Aug 2005
Posts: 1046

PostPosted: Mon Mar 27, 2017 2:00 pm    Post subject: Reply with quote

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
View user's profile Send private message
khayyam
Watchman
Watchman


Joined: 07 Jun 2012
Posts: 6227
Location: Room 101

PostPosted: Mon Mar 27, 2017 2:04 pm    Post subject: Reply with quote

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
View user's profile Send private message
Display posts from previous:   
Reply to topic    Gentoo Forums Forum Index Portage & Programming All times are GMT
Page 1 of 1

 
Jump to:  
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum