Forums

Skip to content

Advanced search
  • Quick links
    • Unanswered topics
    • Active topics
    • Search
  • FAQ
  • Login
  • Register
  • Board index Assistance Portage & Programming
  • Search

How to list all packages emerged on a system...

Problems with emerge or ebuilds? Have a basic programming question about C, PHP, Perl, BASH or something else?
Post Reply
Advanced search
10 posts • Page 1 of 1
Author
Message
fortressfarm
n00b
n00b
Posts: 4
Joined: Mon May 14, 2007 7:54 pm

How to list all packages emerged on a system...

  • Quote

Post by fortressfarm » Wed Aug 27, 2008 6:37 pm

Ladies and Gentlemen,

A few weeks ago my Gentoo laptop survived a sudden thunderstorm... so I thought. A few days later I noticed some executables missing. In the middle of trying to diagnose the problem, it crashed and attempted to reboot. The reboot failed, however, I can get to the disk with a gparted liveCD. Assuming I can fsck and mount the partition... How do I determine what packages were emerged on my system? That way I can rebuild to the point of failure.

Thanks in advance,
Otto
Top
alex.blackbit
Advocate
Advocate
Posts: 2397
Joined: Tue Jul 26, 2005 8:04 pm

  • Quote

Post by alex.blackbit » Wed Aug 27, 2008 6:51 pm

the worldfile (/var/lib/portage/world) lists the packages that you have explicitly installed.
Top
notHerbert
Advocate
Advocate
User avatar
Posts: 2228
Joined: Tue Mar 11, 2008 11:55 pm
Location: 45N 73W

  • Quote

Post by notHerbert » Wed Aug 27, 2008 6:54 pm

If you can chroot in, then you could try this

Code: Select all

emerge -epv world > world.txt
Then browse the file with your favorite pager. This will list all installed packages in the order they would be re-installed. :wink:
Top
alex.blackbit
Advocate
Advocate
Posts: 2397
Joined: Tue Jul 26, 2005 8:04 pm

  • Quote

Post by alex.blackbit » Wed Aug 27, 2008 7:06 pm

notHerbert,

of course emerge -epv world lists _ALL_ installed packages, but i think fortressfarm will only be interested in the packages he explicitly installed, not the dependencies of them.
fortressfarm wrote:That way I can rebuild to the point of failure
makes me believe that he wants to start from scratch.
if you feed the list from world.txt to emerge on a fresh system, you will get either get a crowded worldfile be using

Code: Select all

for i in `cat world.txt`; do
    emerge $i
done
or nothing in worldfile by using

Code: Select all

for i in `cat world.txt`; do
    emerge -1 $i
done
the worldfile itself is enough to rebuild a system. and... of course it's a good idea to copy the configs and user data.
Top
hielvc
Advocate
Advocate
Posts: 2805
Joined: Fri Apr 19, 2002 5:55 pm
Location: Oceanside, Ca

  • Quote

Post by hielvc » Wed Aug 27, 2008 7:22 pm

If they still are there backup /var/lib/portage/world , /var/db/pkg and /etc/make.conf. to generate a list of all files

Code: Select all

find /var/db/pkg|awk -F "/" '$6 !="" {print $5"/"$6}'|sort -u > wrld_file.lst
the above gives a listing like this
  • ....
    xfce-base/xfdesktop-4.4.2-r2
    xfce-base/xfwm4-4.4.2
    xfce-extra/exo-0.3.4
    xfce-extra/xfce4-appfinder-4.4.2
    xfce-extra/xfce4-cpugraph-0.4.0
    xfce-extra/xfce4-dict-0.3.0
    xfce-extra/xfce4-eyes-4.4.0
    xfce-extra/xfce4-mixer-4.4.2
    xfce-extra/xfce4-screenshooter-1.2.0
If you can run " emerge @system -e --with-bdeps y ". If not you need to get a stage3 and as the install manual tells you untar it to "/" and run "emerge @system -uDN --with-bdeps y " then " emerge @world --with-bdeps y -e ".

The problem with getting a stage3 is tha it some time wipes out /var/db/pkg. Right now it seems to be working. If this happens then you can use the world list to rebuild your system.
An A-Z Index of the Linux BASH command line
Top
Exil
Apprentice
Apprentice
User avatar
Posts: 251
Joined: Mon Oct 10, 2005 3:27 am
Location: Nibylandia

  • Quote

Post by Exil » Wed Aug 27, 2008 7:32 pm

Code: Select all

qlist -IC | tr "\n" " " > packagelist
the easiest wat.
Top
hielvc
Advocate
Advocate
Posts: 2805
Joined: Fri Apr 19, 2002 5:55 pm
Location: Oceanside, Ca

  • Quote

Post by hielvc » Wed Aug 27, 2008 7:37 pm

As alex is saying you can feed emerge with your "world" file. What Ive found is that useing

Code: Select all

build="$( < world)" ;  emerge $build -1uDN
allows emerge to figure out the build order.
An A-Z Index of the Linux BASH command line
Top
hielvc
Advocate
Advocate
Posts: 2805
Joined: Fri Apr 19, 2002 5:55 pm
Location: Oceanside, Ca

  • Quote

Post by hielvc » Wed Aug 27, 2008 7:43 pm

Exil only if it works. Mine should work on most livecds, even non-gentoo ones.
An A-Z Index of the Linux BASH command line
Top
alex.blackbit
Advocate
Advocate
Posts: 2397
Joined: Tue Jul 26, 2005 8:04 pm

  • Quote

Post by alex.blackbit » Wed Aug 27, 2008 8:02 pm

of course there are a lot of ways to produce a list of all installed packages. here is my variant:

Code: Select all

$ find /var/db/pkg -mindepth 2 -maxdepth 2 | sed 's/^\/var\/db\/pkg\//=/'|sort
but i still get the idea. what do i need this list for? portage was made for resolving dependencies.
so /var/lib/portage/world should be sufficient for everything you want to do.
Top
notHerbert
Advocate
Advocate
User avatar
Posts: 2228
Joined: Tue Mar 11, 2008 11:55 pm
Location: 45N 73W

  • Quote

Post by notHerbert » Wed Aug 27, 2008 8:18 pm

alex.blackbit

OK, but how can fortressfarm know where 'the point of failure' is ?

That's the tough part, for example, once while I was running 'prelink -amR', the power went out. What a mess! There seemed to be many many, maybe hundreds of 'points of failure', and the fastest way to fix it was emerge -e world.

Cheers :)
Top
Post Reply

10 posts • Page 1 of 1

Return to “Portage & Programming”

Jump to
  • Assistance
  • ↳   News & Announcements
  • ↳   Frequently Asked Questions
  • ↳   Installing Gentoo
  • ↳   Multimedia
  • ↳   Desktop Environments
  • ↳   Networking & Security
  • ↳   Kernel & Hardware
  • ↳   Portage & Programming
  • ↳   Gamers & Players
  • ↳   Other Things Gentoo
  • ↳   Unsupported Software
  • Discussion & Documentation
  • ↳   Documentation, Tips & Tricks
  • ↳   Gentoo Chat
  • ↳   Gentoo Forums Feedback
  • ↳   Duplicate Threads
  • International Gentoo Users
  • ↳   中文 (Chinese)
  • ↳   Dutch
  • ↳   Finnish
  • ↳   French
  • ↳   Deutsches Forum (German)
  • ↳   Diskussionsforum
  • ↳   Deutsche Dokumentation
  • ↳   Greek
  • ↳   Forum italiano (Italian)
  • ↳   Forum di discussione italiano
  • ↳   Risorse italiane (documentazione e tools)
  • ↳   Polskie forum (Polish)
  • ↳   Instalacja i sprzęt
  • ↳   Polish OTW
  • ↳   Portuguese
  • ↳   Documentação, Ferramentas e Dicas
  • ↳   Russian
  • ↳   Scandinavian
  • ↳   Spanish
  • ↳   Other Languages
  • Architectures & Platforms
  • ↳   Gentoo on ARM
  • ↳   Gentoo on PPC
  • ↳   Gentoo on Sparc
  • ↳   Gentoo on Alternative Architectures
  • ↳   Gentoo on AMD64
  • ↳   Gentoo for Mac OS X (Portage for Mac OS X)
  • Board index
  • All times are UTC
  • Delete cookies

© 2001–2026 Gentoo Foundation, Inc.

Powered by phpBB® Forum Software © phpBB Limited

Privacy Policy