Fixing the world file

Anything that pertains to Portage

Moderator: Moderators

Fixing the world file

Postby valczir » Mon Nov 10, 2008 16:20

So, I was having issues updating sabayon with portage. I got most of the way there, but it was still being annoying. Eventually, I got to the end and started an emerge @preserved-rebuild, but I ran into a problem pretty quickly - packages from the kde-4 slot were installed, and when i went to emerge @preserved-rebuild, it wanted to re-emerge those packages in the kde-4 slot.

So, naturally, I started an emerge --depclean. And then I noticed all sorts of important packages flying out the window. GIMP, p7zip, ntfs3g... All sorts of things I use plenty often.

I started looking through the world file and noticed that not only are some installed applications missing from the world file, but many packages that should be considered dependencies (and, therefor, not in the world file) were listed.

So I was wondering if anyone knows of some type of script that can go through a list of applications and, if no installed applications depend on it, output that application to a text file. It'd basically be something like getting a list of installed apps from eix --installed --only-names, then doing an equery depends on each of those packages to see if anything depends on it. If something depends on it, it doesn't need to be in the world file, so ignore it. If nothing depends on it, output to a text file (which would eventually replace the world file).

Granted, my way of doing things is far from perfect - I'm sure that there would still be plenty of flaws in that file, but at least I'd have something relatively compact which contains all of the programs installed on my system.

So yeah, is there anything like that? If not, I can throw together a script for myself, but I wanted to know if any of you guys know of some program that does something like that - I don't want to waste time reinventing the wheel, as it were.
valczir
Baby Hen
 
Posts: 9
Joined: Wed Oct 29, 2008 7:24
Location: Minnesota

Re: Fixing the world file

Postby freeallbadgers » Mon Nov 10, 2008 20:21

NEVER, EVER run --depclean , without --pretend.

As for script, no idea.
“I just finished compiling glibc and now it says there is a new update available? Arrgh! It never ends!!”
User avatar
freeallbadgers
Growing Hen
 
Posts: 181
Joined: Sun Mar 11, 2007 8:12
Location: Glasgow, UK.

Re: Fixing the world file

Postby DontPanic » Mon Nov 10, 2008 20:47

I haven't tried it since they updated portage, but I used to use a package called app-portage/udept to clean my world file.

However, it would not do anything about trying to figure out packages that really belonged there.

As with depclean, always used the udept package with --pretend, and carefully look at what it wants to do.
Gigabyte GA-P35-DS3L - Intel(R) Core(TM)2 Duo CPU E6750@ 2.66GHz
nVidia GeForce 7600 GS
2 GB RAM
User avatar
DontPanic
Old Dear Hen
 
Posts: 742
Joined: Mon Jul 09, 2007 20:29
Location: Mobile, AL, USA

Re: Fixing the world file

Postby WarraWarra » Mon Nov 10, 2008 22:17

You have a great idea , just might have to take it a bit further as likely you have equo and have updated equo tree so would have to look at /etc/make.conf as well as equo make.conf and laymans make.conf as well , heck check out all make.conf and make sure all of them is the same.

Likely layman is different from equo and from /etc/make.conf and this can cause a few :( to happen.

Then go about checking what is installed and how to remove excess , udept is one of the better ones to use "dep --help"

Also check lingua in make.conf as you surely do not need mandarin or urdu languages or ati / sis / intel video if you do not have the hardware and this causes more bloatware.

Actually ideally you would want to install core and then using equo build your system from there with minm. make.conf options same as gentoo handbook from scratch idea except you can use equo to safe a few days compiling.
This way you know what you want is there and is satisfied.
gcc , python , kde is always a pain in the ear so spend more time working and fine tuning them / latest versions with kde only if needed or wait till kde has a kde lite version without the bloatware.

Yes I am a kde fan but xfce or e17 or similar might do the job well enough + performance without KDE and the issues that goes hand in hand with it.

Def. worth a try especially using say 3.5 dvd + mod it so it pulls in updates during install same as gentoo online install does so use what is there and current + add latest from online during core install.

If none of this makes sense ignore it.
User avatar
WarraWarra
Sagely Hen
 
Posts: 1989
Joined: Wed Jan 03, 2007 21:01
Location: 31.324270, -113.585511

Re: Fixing the world file

Postby valczir » Mon Nov 10, 2008 23:19

Yeah, I know I'm supposed to do --pretend before --depclean, but the thing is, I was stuck in the command line (I have a GTX 260, and the version of nvidia-drivers on the LiveDVD isn't new enough for that card - heck, equo won't even update to a new enough version of nvidia-drivers for that card, I had to use portage), and the buffer size was tiny. I suppose, I could have output the command to a file and checked it there, but I was being lazy, at the time. Anyway, it's not a big deal - I have a separate partition for /home, and that's the only place that I had anything that I really needed. So I just reinstalled sabayon without formatting the /home partition.

I've pruned my make.conf already, but to be perfectly honest, I prefer gentoo's package manager, even though it may take much longer to install. I'm on a high end gaming rig, and I love to be on the bleeding edge of linux development (especially since some things don't work if I'm not on the bleeding edge), so I prefer portage's bleeding edge packages to equo's slightly out of date ones.

I'm normally an e17 guy, but I kinda got sick of their lack of a system tray. I used stalonetray for a while, but I'm just going to use KDE for now. I'll move back to e17 when I'm ready for some major work to be done.

Hmmm... I guess I'll get started on that script. Shouldn't be too hard to program - I just need to learn how to program in bash, quick.
valczir
Baby Hen
 
Posts: 9
Joined: Wed Oct 29, 2008 7:24
Location: Minnesota

Re: Fixing the world file

Postby dagurasu » Mon Jan 03, 2011 3:45

Hi guys, been a long time since I've been around here.. maybe even longer than this old thread. A couple of you may remember I posted something like this years ago, even before this one. Still wondering where it stands. Maybe it is implemented and I just haven't figured out how. Sorry, I'll admit I haven't searched enough.

I've had to reinstall a couple of times for different reasons or just wanted to clean up and wished I had a properly working world file. No automated tool can build a proper world file when one doesn't already exist. the world file as designed in gentoo, should typcially contain a list of all things you want to have installed for their own sake (not just because they make something else work). A world file could simply consist of something like k3b, and nothing else, and that should produce a working system sufficient for running k3b. If someday you remove k3b.. then presumably you don't require linux any longer.(ok probably baselayout and the kernel stay there just in case you change your mind)

example: I want k3b. But I also directly use cd-record or whatever it's called (I forgot). Maybe someday I don't want k3b, but I still use cd-record for command-line purposes. I want both in my world file so cd-record doesn't get uninstalled if I uninstall k3b. No automated tool can know that. It's a list that is built by adding package names that the admin asks to have installed. Any depenancies he didn't ask for are not included in that list and can be removed later if they are not needed by something in the world file.

This view of the world file allows gentoo installs to be easily modifiable (by editing a manageably sized and recognizeable list) for what the admin wants (or doesn't want anymore) while still pulling in everything he needs and allow uninstall dependancies to actually make sense.

I briefly try out new packages all the time so I need the system to know which things I still really want and need and I need an easily editable world file that I can copy to a new system to define a new installation. The thing is, sabayon was built on a system that already had this right. It's kind a shame if it's lost.
dagurasu
Simple Hen
 
Posts: 82
Joined: Fri Jun 01, 2007 23:33

Re: Fixing the world file

Postby Fitzcarraldo » Mon Jan 03, 2011 15:20

Some time ago I bookmarked the following blog post about a Python script: Manaully clean your Gentoo world file.

Some other pages I've bookmarked over the last few years which touch on the subject of cleaning the world file:

[gentoo-user] Clean up world file

Cleaning out my world file

Timely Maintenance of your Gentoo Linux Computer

How to keep a Gentoo installation in good condition?
User avatar
Fitzcarraldo
Sagely Hen
 
Posts: 7334
Joined: Sat Mar 10, 2007 5:40
Location: United Kingdom

Re: Fixing the world file

Postby dagurasu » Tue Jan 04, 2011 3:51

I know how to clean it. I've written scripts to first find all packages which nothing depends on, then all packages with only one reverse dependancy. Then manually scan through keeping or deleting things then accept the that some things lower down I might want for their own sake aren't likely to get removed anyway since I'd have to uninstall a couple of things for them to get removed(although that happens sometimes because I install and uninstall things quite a bit, often related things together.).. and accept that if that happens oh well, I'll just deal with, no big deal.

Fine.... but I gave up on this long ago, because still every time I install something new(about twice a week) that pulls in a bunch of stuff it's going to get all messed up again. And every time I do a new install I either have to start fresh reinstalling things for a month afterwards or bring in all the old mess from my last system, half of which I didn't want to keep anyway. The problem is not how to make a clean world file. The problem is how to get sabayon to respect the original intended purpose of the world file... which was never meant to be a list of all installed packages. It's meant to be a way to understand what packages the admin explicitly, not implicitly, cares about having.

I understood in the early years of sabayon, but I assumed it would it get fixed eventually. Inability to do package list maintenance in a sane way is about to drive me back to distro searching. It's really sad because I don't think any distro has a better way of doing it than gentoo, which sabayon is built on.
Last edited by dagurasu on Tue Jan 04, 2011 4:12, edited 1 time in total.
dagurasu
Simple Hen
 
Posts: 82
Joined: Fri Jun 01, 2007 23:33

Re: Fixing the world file

Postby dagurasu » Tue Jan 04, 2011 3:56

And how in the world does sabayon make recursive decisions about what to uninstall anyway? (my point in my post some years ago) Does it just guess that if you're removing package A and package B is a dependency of A and nothing else that surely you must not want package B anymore?

Actually it seems(just seems.. without close observation) recently it's less eager and tends to just un-install one thing leaving all the stale dependencies behind. When every single package gets dumped in the world file there is no right way to handle uninstall dependencies. It's simply impossible to know what dependencies the admin intended to keep.

Does entropy even care about the world file? Actually, I've never gone the bring all the old crust route, I've only gone the start fresh route. I don't even know if it's possible to dump a world world file into a minimal sabayon install and use entropy to reinstall all the packages... without writing a script for it anyway. But the reason i don't know, is because even if can, for me, it would just make a mess, so I never tried. Or maybe I did know and I forgot (for the same reason).

If I had time I'd write my own universe file and a wrapper script for equo to handle it properly. Wrapper scripts obviously aren't the elegant solution though.
dagurasu
Simple Hen
 
Posts: 82
Joined: Fri Jun 01, 2007 23:33

Re: Fixing the world file

Postby joost » Tue Jan 04, 2011 9:16

Entropy keeps track off things you install.

equo install A --> Package A will be remembered as a user choice (kind off listed in an internal world file). Any dependency that gets pulled in will not.
equo remove A --deep --> removes package A with all dependencies that are not needed anymore.

For all I know Entropy does write/remove from the Portage world file if needed. But it will never throw in all things it installed.

To find more stuff you might not need anymore, another trick to try is:
equo unusedpackages --sortbysize

But be carefull with that, you might remove things you shouldn't.
User avatar
joost
Sagely Hen
 
Posts: 2313
Joined: Fri Nov 17, 2006 12:11
Location: The Netherlands

Next

Return to Portage|Emerge Package Managers

Who is online

Users browsing this forum: No registered users and 0 guests