Gentoo Forums
Gentoo Forums
Gentoo Forums
Quick Search: in
Question about cleaning up world file
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
libertytrek
Apprentice
Apprentice


Joined: 18 Jul 2007
Posts: 258

PostPosted: Mon Mar 02, 2015 1:07 pm    Post subject: Question about cleaning up world file Reply with quote

Hi all,

Googling on a minor issue with perl-cleaner after the 5.20 upgrade, I ran across a post from the gentoo user mail list from Mick that said:

"you shouldn't really have any libs in your world file. Any required
would be pulled in as dependencies."

Is this in fact true?

I checked mine, and found:

# grep -i libs /var/lib/portage/world
app-emulation/emul-linux-x86-baselibs
dev-libs/apr
dev-libs/apr-util
dev-libs/boost
dev-libs/elfutils
dev-libs/glib
dev-libs/gmp
dev-libs/libaio
dev-libs/libdnet
dev-libs/libevent
dev-libs/libffi
dev-libs/libgcrypt
dev-libs/libgpg-error
dev-libs/libksba
dev-libs/libpcre
dev-libs/libyaml
dev-libs/oniguruma
dev-libs/openssl
media-libs/libjpeg-turbo
media-libs/libpng
net-libs/libtirpc
net-libs/serf
sys-libs/cracklib
sys-libs/glibc
sys-libs/libcap
sys-libs/timezone-data

So, should I delete all of these? Even glib and glibc?

Also - is there a definitive guide (preferably for non programmer types) on just how to properly clean the world file?

Thanks.
Back to top
View user's profile Send private message
charles17
Advocate
Advocate


Joined: 02 Mar 2008
Posts: 3664

PostPosted: Mon Mar 02, 2015 1:52 pm    Post subject: Reply with quote

Just deselect them.
Quote:
# emerge --deselect=y <package>

And check
Quote:
$ for i in $(cat /var/lib/portage/world); do equery d $i; done
Back to top
View user's profile Send private message
gerard27
Advocate
Advocate


Joined: 04 Jan 2004
Posts: 2377
Location: Netherlands

PostPosted: Mon Mar 02, 2015 2:03 pm    Post subject: Reply with quote

libertytrek,
Deselect might damage your system.
Run
Code:

emaint -p world

Gerard.
_________________
To install Gentoo I use sysrescuecd.Based on Gentoo,has firefox to browse Gentoo docs and mc to browse (and edit) files.
The same disk can be used for 32 and 64 bit installs.
You can follow the Handbook verbatim.
http://www.sysresccd.org/Download
Back to top
View user's profile Send private message
libertytrek
Apprentice
Apprentice


Joined: 18 Jul 2007
Posts: 258

PostPosted: Mon Mar 02, 2015 2:20 pm    Post subject: Reply with quote

Ran that, but:

# emaint -p world
Emaint: check world 100% [============================================>]

That was the only output...
Back to top
View user's profile Send private message
lexflex
Guru
Guru


Joined: 05 Mar 2006
Posts: 363
Location: the Netherlands

PostPosted: Mon Mar 02, 2015 2:24 pm    Post subject: Re: Question about cleaning up world file Reply with quote

Hi,

libertytrek wrote:
Hi all,
"you shouldn't really have any libs in your world file. Any required would be pulled in as dependencies."
Is this in fact true?

The world file only should contain the files you explicitly installed. It does not need to contain the dependencies since they are -indeed- pulled in during emerge (and cleaned if the dependency is no longer needed, for example when useflags are changed). However: In some ( rare) cases you might need a library for some (experimental) program for which no ebuild is available. In that case you can explicitly install that library, and it is added to the world file.

My guess would be those entries you see are added because of 'reinstalls' of packages later on, without using '--oneshot' ( oneshot just (re)emerges a package without adding it to the world file).


Quote:
Also - is there a definitive guide (preferably for non programmer types) on just how to properly clean the world file?
Thanks.


I dont know, but basically, for each file you need to decide if you would have installed it explicitly, or that it would have been pulled in automatically.
As suggested, you can use 'equery depends' to see what packages depend on a given package. If so, it would have been pulled in automatically.

For example: libgpg-error is not in my world file, and 'equery depends libgpg-error' shows it depends on app-crypt/gnupg.

Alex.
Back to top
View user's profile Send private message
libertytrek
Apprentice
Apprentice


Joined: 18 Jul 2007
Posts: 258

PostPosted: Mon Mar 02, 2015 2:33 pm    Post subject: Reply with quote

Thanls textflex...

So, what would be the worst case scenario if I deleted one that I had installed but forgotten about and still needed?
Back to top
View user's profile Send private message
lexflex
Guru
Guru


Joined: 05 Mar 2006
Posts: 363
Location: the Netherlands

PostPosted: Mon Mar 02, 2015 2:38 pm    Post subject: Reply with quote

libertytrek wrote:
So, what would be the worst case scenario if I deleted one that I had installed but forgotten about and still needed?


Well, there might be dependencies on that packages that would get removed if you emerge clean your system.
I guess you would need to re-emerge the files if needed.

Best is to always double-check, for example using emerge update pretend, to see if other packages get removed.

Also , do not 'unmerge' packages: You want to keep them on your system , but only remove them from your worldfile....

Before starting to remove packages from the worldfile (using emerge) you best make a copy of your worldfile (cp /var/lib/portage/world to world_bu_date or something) , so you can easily look up the files that where there before you started cleaning...
Back to top
View user's profile Send private message
lexflex
Guru
Guru


Joined: 05 Mar 2006
Posts: 363
Location: the Netherlands

PostPosted: Mon Mar 02, 2015 3:07 pm    Post subject: Reply with quote

PS:

More on cleaning your worldfile is on the forum in "unsupported" :

https://forums.gentoo.org/viewtopic-t-142475-postdays-0-postorder-asc-highlight-clean%2Bworldfile-start-700.html

I would NOT recommend you to 'just' use one of the scripts shown there, but it gives an idea of the procedures used.
Back to top
View user's profile Send private message
libertytrek
Apprentice
Apprentice


Joined: 18 Jul 2007
Posts: 258

PostPosted: Mon Mar 02, 2015 3:17 pm    Post subject: Reply with quote

Nice, thanks again!
Back to top
View user's profile Send private message
Irre
Guru
Guru


Joined: 09 Nov 2013
Posts: 434
Location: Stockholm

PostPosted: Mon Mar 02, 2015 7:47 pm    Post subject: Reply with quote

We discussed this some days ago. This script removes not needed entries in the world-file:
Code:
for i in `cat /var/lib/portage/world`
do
  if emerge -p --depclean $i |
    grep "These are the packages that would be unmerged:">/dev/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
Back to top
View user's profile Send private message
charles17
Advocate
Advocate


Joined: 02 Mar 2008
Posts: 3664

PostPosted: Tue Mar 03, 2015 12:34 pm    Post subject: Reply with quote

gerard82 wrote:
Deselect might damage your system.
Could you please drop some words on how/why deselecting packages could damage a system?
Back to top
View user's profile Send private message
steveL
Watchman
Watchman


Joined: 13 Sep 2006
Posts: 5153
Location: The Peanut Gallery

PostPosted: Tue Mar 03, 2015 3:01 pm    Post subject: Reply with quote

I find this easiest:
Code:
cp -p /var/lib/portage/world /root/world.bak
nano /var/lib/portage/world
because ctrl-K to delete entries is so quick. :)
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