Gentoo Forums
Gentoo Forums
Gentoo Forums
Quick Search: in
world file clean-up
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
EasterParade
l33t
l33t


Joined: 26 Jul 2003
Posts: 938

PostPosted: Sat Oct 09, 2021 2:41 pm    Post subject: world file clean-up Reply with quote

Recently I asked a very dumb question here.

While I am at it I´d like to ask about the following packages.
They sit in the world file. Could I remove them from the world file?
Is it recommendable or advisable to remove those?

Everything KDE including akonadi etc, everything that ends with -meta and -frameworks.

And what about the myriad of small perl packages? Could they go or need they stay?

Thanks for any suggestion.
Back to top
View user's profile Send private message
fedeliallalinea
Administrator
Administrator


Joined: 08 Mar 2003
Posts: 30837
Location: here

PostPosted: Sat Oct 09, 2021 3:28 pm    Post subject: Reply with quote

In the world file there should be only the packages you want to use and not its dependencies.
For example if you use plasma you should only have kde-plasma/plasma-meta in the world file
so if one day you want to uninstall it just emerge -C kde-plasma/plasma-meta and then
emerge --depclean to remove the dependencies (if they are not in the world file and nobody
depends on them they will be removed).
There is also a script to check the world file sanity.
_________________
Questions are guaranteed in life; Answers aren't.
Back to top
View user's profile Send private message
Etal
Veteran
Veteran


Joined: 15 Jul 2005
Posts: 1931

PostPosted: Sat Oct 09, 2021 3:38 pm    Post subject: Reply with quote

The world file should only contain the packages you specifically want installed. It ensures that when you run "emerge -a --depclean" it doesn't remove them.

You should be able to recognize the packages in the list. Usually, the random packages end up there because you needed to re-emerge some package at some point but didn't use -1/--oneshot option.

So I assume the kde -meta packages you want to keep. If you don't know what those perl packages are, you can remove them.

Once you clean up your world file, you can run "emerge -p --depclean" and see what it proposes to uninstall. If there are things you want to keep, you can always run "emerge --noreplace <package>" to add them back to the world file.
Back to top
View user's profile Send private message
APolozov
Apprentice
Apprentice


Joined: 28 Sep 2006
Posts: 189
Location: Voronezh, Russia

PostPosted: Sat Oct 09, 2021 3:38 pm    Post subject: Reply with quote

IMHO the world file should contain a list of only those packages that you personally need and those packages that you want to keep, even if they are subject to deletion due to dependencies.
For example my worldfile:
Code:

app-admin/hddtemp
app-admin/logrotate
app-admin/metalog
app-admin/sudo
app-admin/testdisk
app-arch/p7zip
app-arch/rar
app-arch/tarsync
app-arch/unrar
app-cdr/cdrtools
app-cdr/iat
app-editors/nano
app-emulation/virtualbox-additions
app-emulation/virtualbox-extpack-oracle
app-emulation/wine-staging
app-misc/mc
app-portage/cpuid2cpuflags
app-portage/emerge-delta-webrsync
app-portage/gentoolkit
app-shells/bash-completion
app-shells/gentoo-bashcomp
dev-util/strace
games-emulation/dosbox
kde-apps/dolphin
kde-apps/konsole
kde-apps/okular
kde-plasma/plasma-meta
media-gfx/exif
media-gfx/xsane
media-sound/alsa-utils
media-sound/bluez-alsa
media-sound/mp3splt
media-sound/mp3val
media-tv/w_scan
media-video/mplayer
media-video/mpv
net-ftn/golded+
net-ftn/qicoxe
net-misc/dhcpcd
net-misc/minidlna
net-misc/ntp
net-p2p/ktorrent
net-p2p/syncthing
sys-apps/hdparm
sys-apps/memtest86+
sys-apps/mlocate
sys-apps/swapspace
sys-apps/usbutils
sys-boot/grub
sys-fs/mdadm
sys-fs/mtpfs
sys-fs/ntfs3g
sys-kernel/gentoo-sources
sys-kernel/linux-firmware
sys-power/acpid
sys-process/cronie
sys-process/htop
virtual/husky
www-client/firefox

_________________
Excuse my bad English, I only study it.
Back to top
View user's profile Send private message
cboldt
Veteran
Veteran


Joined: 24 Aug 2005
Posts: 1046

PostPosted: Sat Oct 09, 2021 4:45 pm    Post subject: Reply with quote

Here is how I cleaned my "world" file. I ran this little ditty to get an idea of what was in "world" that didn't need to be there.

Code:
for i in `cat /var/lib/portage/world`;do printf "$i:\n";qdepends -Q -qq $i;done


This results in a list of packages in "world" with a ":" immediately after the name of each package that is in "world." For some of the packages, additional packages (not in world) will be listed below. That means that the package below depends on the package above, so the package above (supposedly) doesn't need to be in "world."

HOWEVER, MASSIVE EXCEPTION - before doing `emerge --deselect packagename` to remove packagename from world, if the package below is a virtual, keep "packagename" in world. There are an additional few that that this process suggests might be removed, but I keep them in ...

app-admin/logrotate (supposedly pulled in by sys-apps/portage)
app-portage/gentoolkit (supposedly pulled in by sys-apps/portage)
net-fs/samba (supposedly pulled in by dev-perl/Parse-Yapp)
x11-terms/rxvt-unicode (supposedly pulled in by sys-libs/ncurses)

I'm not able to articulate a good explanation for my judgement there, other than the supposedly excess appearance in world is of a package that I don't trust will stay in place if I take it out of world, or the dependency seems upside down. That concern can be tested, but even then I'm simply (maybe irrationally) leery of taking certain package names out of the world file.

Testing consists of taking a packgename out of the world file (emerge --deselect packagename), then doing a pretend emerge --depclean (emerge -pv --depclean) to see if any package is removed. If not, then there was no need for the packagename to appear in world in the first place. The command to restore packagenename to the world file without recompiling it is `emerge --select --noreplace packagename`

I cleaned out a good 20% of packagenames in world with this process. Some excess entries I attribute to the order (over years) of bringing in new programs and facilities. Other excess was because I was not (still not) disciplined to do the --oneshot when troubleshooting / changing USE flags to test, and similar.
Back to top
View user's profile Send private message
EasterParade
l33t
l33t


Joined: 26 Jul 2003
Posts: 938

PostPosted: Sat Oct 09, 2021 5:07 pm    Post subject: Reply with quote

Thank you all very much; very helpful.
So, many more stuff will remain than I thought.
After using the script I will know better.

Thanks again
Back to top
View user's profile Send private message
Irre
Guru
Guru


Joined: 09 Nov 2013
Posts: 434
Location: Stockholm

PostPosted: Sat Oct 09, 2021 6:26 pm    Post subject: Reply with quote

I run this script to clean the world:
Code:
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
Back to top
View user's profile Send private message
NeddySeagoon
Administrator
Administrator


Joined: 05 Jul 2003
Posts: 54096
Location: 56N 3W

PostPosted: Sat Oct 09, 2021 7:03 pm    Post subject: Reply with quote

transsib,

There are no dumb questions, except the one you don't ask, as you never know the answer.
Be on your guard for dumb answers though.

All these scripts that help clean your world file are only advisories.
You decide what you really want there.

System set packages should not normally be there but if you want to keep gcc-2.95 installed because you have a use for it, its your gentoo, your way.
_________________
Regards,

NeddySeagoon

Computer users fall into two groups:-
those that do backups
those that have never had a hard drive fail.
Back to top
View user's profile Send private message
Jaglover
Watchman
Watchman


Joined: 29 May 2005
Posts: 8291
Location: Saint Amant, Acadiana

PostPosted: Sat Oct 09, 2021 9:06 pm    Post subject: Reply with quote

world file is practically the only place in your computer where you delete everything you do not know what it is for. And as NeddySeagoon said, only you, armed with a text editor, can sanitize it.
_________________
My Gentoo installation notes.
Please learn how to denote units correctly!
Back to top
View user's profile Send private message
figueroa
Advocate
Advocate


Joined: 14 Aug 2005
Posts: 2912
Location: Edge of marsh USA

PostPosted: Sun Oct 10, 2021 3:17 am    Post subject: Reply with quote

Another general rule, libraries are dependencies and shouldn't be in world. I have one lib in my world file, sys-libs/ncurses-compat, and I've forgotten why I added it, but it's not a dependency, and something not too long ago compelled me to add it.
_________________
Andy Figueroa
hp pavilion hpe h8-1260t/2AB5; spinning rust x3
i7-2600 @ 3.40GHz; 16 gb; Radeon HD 7570
amd64/17.1/desktop (stable), OpenRC, -systemd -pulseaudio -uefi
Back to top
View user's profile Send private message
EasterParade
l33t
l33t


Joined: 26 Jul 2003
Posts: 938

PostPosted: Sun Oct 10, 2021 11:26 am    Post subject: Reply with quote

I haven´t used any script yet, just scrutinized the file for stuff that should not be there, like any python.
Quote:
All these scripts that help clean your world file are only advisories.
You decide what you really want there.

I so miss porthole: it helped at getting a quicker view on dependencies. But I understand that porthole
is gone. So, NeddySeagoon, sometimes I take a good guess or try my luck with equery d.
Quote:
world file is practically the only place in your computer where you delete everything you do not know what it is for.

A leap of faith, careful judgement and analysis.
Quote:
Another general rule, libraries are dependencies and shouldn't be in world

Thanks for the clear statement too.

NeddySeagoon, I got more "dumb" questions ...
Back to top
View user's profile Send private message
NeddySeagoon
Administrator
Administrator


Joined: 05 Jul 2003
Posts: 54096
Location: 56N 3W

PostPosted: Sun Oct 10, 2021 11:32 am    Post subject: Reply with quote

transsib,

transsib wrote:
NeddySeagoon, I got more "dumb" questions ...

Then ask, and filter the answers. :)
_________________
Regards,

NeddySeagoon

Computer users fall into two groups:-
those that do backups
those that have never had a hard drive fail.
Back to top
View user's profile Send private message
The Doctor
Moderator
Moderator


Joined: 27 Jul 2010
Posts: 2678

PostPosted: Mon Oct 11, 2021 2:08 am    Post subject: Reply with quote

I don't let my file get too polluted so what I do as a clean up routine is to read the file and for anything I'm unsure of I emerge --deselect it and then run emerge -pc. If portage wants to nuke something I know it should be in the world file so I can emerge --select it. Also any maintenance rebuilds you do should include the -1 option so the world file doesn't get polluted in the first place. Normally its only really edge cases like utilities that should be dependencies but aren't because 3rd party and such.
_________________
First things first, but not necessarily in that order.

Apologies if I take a while to respond. I'm currently working on the dematerialization circuit for my blue box.
Back to top
View user's profile Send private message
SDRRadioGuy
n00b
n00b


Joined: 18 Jul 2023
Posts: 1
Location: Irvine, California, USA

PostPosted: Tue Jul 18, 2023 10:32 pm    Post subject: World file check from the Gentoo Wiki Reply with quote

I used the suggestions from the Gentoo Wiki to clean up my world file. The script on the Wiki is faster that the ones above and has fewer incorrect packages recommended for "deselection".

https://wiki.gentoo.org/wiki/User:Vaukai/checkworldfile
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