For example no package depends on xload on my system:
Code: Select all
system ~ # equery d xload
* These packages depend on xload:
system ~ #
Thanks
Code: Select all
system ~ # equery d xload
* These packages depend on xload:
system ~ #
But world is what I have. I ask what I have but no other package needs.dol-sen wrote:@selected means it is pulled in by the world file or the profile, (most probably the world file)
You can manually look over your world file and do some house cleaning, then running the -pc options will likely find some packages to clean.

It is good maintenance, I agree, but some help from tools themselves would be great to spot widelands in a set of <500 as opposed to >3000 possibilities.The Doctor wrote:I think you best tool for that is going to be to use less to look at /var/lib/portage/world and find the packages you personally don't think are necessary. For example, if widelands is the world file but you don't have a clue what it is then you can emerge --deslelect it and then you can run emerge -pc and see what gets freed up.
This is good maintenance to do anyway.

Code: Select all
wc -l /var/lib/portage/world
143 /var/lib/portage/worldCode: Select all
localhost Desktop # cat ../cleanup.sh
for i in `cat /var/lib/portage/world`
do
if emerge -p --depclean $i | grep "These are the packages that would be unmerged:">null
then echo $i >>/var/lib/portage/world-new
else echo "removing:" $i
fi
done
mv /var/lib/portage/world /var/lib/portage/world-previous
mv /var/lib/portage/world-new /var/lib/portage/worldUse qdepends instead of equery. It is much faster.mDup wrote:Of course one can do 'equery d $p' for every $p one has (perhaps >3000) and inspect output.
Code: Select all
$ for i in $(cat /var/lib/portage/world); do echo $i && qdepends -Q $i; donecharles17 ... or the 'demoggified' version ;)charles17 wrote:Code: Select all
$ for i in $(cat /var/lib/portage/world); do echo $i && qdepends -Q $i; done
Code: Select all
# while read i ; do echo $i ; qdepends -Q $i ; done </var/lib/portage/world@mDup ... I'm really having difficulty undertsanding your problem, both the ftp server and 'fubar' are in the world file, and all you need do is look and ask yourself "why do I have {x}", sure you could check every installed package looking for those that aren't a dependency of some other package, but isn't that effectively what the world file is (or should be, assuming the correct use of --oneshot)?mDup wrote:Agreed, I may have an ftp server package and no other package needs it. But I may need it (if I run an ftp server). Conversely several years ago one may have emerged 'fubar' which looked fun and then one forgot forever. But 'fubar' holds on dependencies one really does not want anymore. And sure one does no longer need funny 'fubar'.
Irre ... the following would remove the requirement for grep, and cat, and so be a little leaner.Irre wrote:Code: Select all
for i in `cat /var/lib/portage/world` do if emerge -p --depclean $i | grep "These are the packages that would be unmerged:">null then echo $i >>/var/lib/portage/world-new else echo "removing:" $i fi done mv /var/lib/portage/world /var/lib/portage/world-previous mv /var/lib/portage/world-new /var/lib/portage/world
Code: Select all
#!/bin/sh
while read i ; do
if [ -n "$(emerge -pq --depclean $i)" ]; then
echo $i >>/var/lib/portage/world-new
else
echo "removing:" $i
fi
done </var/lib/portage/world
if [ -f /var/lib/portage/world-new ]; then
mv /var/lib/portage/world /var/lib/portage/world-previous ;
mv /var/lib/portage/world-new /var/lib/portage/world
fiWow.The Doctor wrote:If your world file has more than 500 packages in it you have a serous problem and with more than 3000 your plight would be desperate.Code: Select all
wc -l /var/lib/portage/world 143 /var/lib/portage/world
Amongst many real dependencies it could show some cases like these where inkscape and p7zip need to stay listed in /var/lib/portage/world or otherwise would get removed on next emerge -ac.mDup wrote:I'll compare what both report as having nothing depend on <package> when all ~3000 <package>s are done.
Code: Select all
media-gfx/inkscape
app-office/texmacs-1.99.2-r1Code: Select all
app-arch/p7zip
app-arch/xz-utils-5.2.2Good questionVoidMage wrote:To extend the original question, how would you go about a case, when the potential candidates for removal are leaves, but aren't listed in world (for example being results of a long forgotten 'emerge -1o') ?
Code: Select all
% equery l '*' --format='$cp' | cat | sort | uniq > tmp/equery.l.do
% \cp -p /var/lib/portage/world tmp/world.orig
% \cp -p tmp/equery.l.do /var/lib/portage/world
Code: Select all
% cat /var/lib/portage/world | cut -d: -f1 | uniq > xxx
% \mv xxx /var/lib/portage/world
Thanks khay, I am still learningkhayyam wrote:charles17 ... or the 'demoggified' version
Code: Select all
# while read i ; do echo $i ; qdepends -Q $i ; done </var/lib/portage/world
Code: Select all
# while read i ; do if [ -n "$(qdepends -Q $i)" ]; then emerge --deselect $i ; fi; done < /var/lib/portage/worldPolluting /var/lib/portage/world may cause trouble in dependency resolution when updating your system.mDup wrote:well ... contrary to other people habits I do not remove anything from world.
Ideally world for me is all I have installed.
Code: Select all
$ ls -al /var/db/pkg/*


Not for circular dependencies. Example:charles17 wrote:Wouldn't --depclean remove them even with foo/bar kept in world?Yamakuzure wrote:So if all packages depending on foo/bar are dependencies themselves and not listed in the world file, removing foo/bar from world will result in --depclean wanting to remove *all* of them!
Code: Select all
$ qdepends -Q media-video/avidemux # <-- in world file
media-libs/avidemux-plugins-2.6.8
media-libs/avidemux-core-2.6.8
$ qdepends -Q media-libs/avidemux-core
media-libs/avidemux-plugins-2.6.8
media-video/avidemux-2.6.8 # <-- in world fileCircular dependencies are a problem in general. But how many of such cases are there in emerge --depclean -p after runningYamakuzure wrote:So if you --deselect media-video/avidemux, because two packages depend on it, --depclean will remove all three
I just tried it, that's how I found out.
Code: Select all
# while read i ; do if [ -n "$(qdepends -Q $i)" ]; then emerge --deselect $i ; fi; done < /var/lib/portage/worldThe packages in world are checked to see if they are dependent, or independent.Yamakuzure wrote:There is a very big problem with trying to use qdepends like this: It lists all packages that depend on the package you check, but this includes packages that are *not* in your world file.
I really don't get this, if foo/bar (a dependency of some other package) is removed from world then the package apon which it is a dependency still exists in world, no? If it were 'independent' of any dep then removing it from world would cause its dependencies to be selected by --depclean, but the fact that it is a dependency means it is a dependency of some 'independent' package in world.Yamakuzure wrote:So if all packages depending on foo/bar are dependencies themselves and not listed in the world file, removing foo/bar from world will result in --depclean wanting to remove *all* of them!