Gentoo Forums
Gentoo Forums
Gentoo Forums
Quick Search: in
World file cleaner tool?
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
Dragonlord
Guru
Guru


Joined: 22 Aug 2004
Posts: 446
Location: Switzerland

PostPosted: Sat Sep 09, 2017 2:21 pm    Post subject: World file cleaner tool? Reply with quote

I've had yet another blocker problem for which in the end I went through the world file and tried to delete nilly-willy stuff in the hope to get it working.

Now when I understand this correctly then the world file should only contain stuff I installed "manually". It seems at times dependency stuff gets in there or manual stuff turns dependency. So looking at this problem I'm curious to know if there is a tool which you can run over the world file to identify entries which are dependencies of other packages and thus should not be in the world file (anymore).

Does such a tool exist or could the gentoo devs add such a tool? (or the functionality to another tool that exists already)
_________________
DragonDreams: Leader and Head Programmer
Back to top
View user's profile Send private message
charles17
Advocate
Advocate


Joined: 02 Mar 2008
Posts: 3664

PostPosted: Sat Sep 09, 2017 2:26 pm    Post subject: Reply with quote

See https://wiki.gentoo.org/wiki/World_set_%28Portage%29#Keep_it_clean
Back to top
View user's profile Send private message
saboya
Guru
Guru


Joined: 28 Nov 2006
Posts: 552
Location: Brazil

PostPosted: Sat Sep 09, 2017 2:44 pm    Post subject: Reply with quote

No, because there's no way to make sure it SHOULD'T be in the world file. A lot of assumptions could be made, such as "libs are probably not what you want there", but in some cases you might actually do that for a reason.

You just have to be careful when emerging stuff. emerge it with -1 if you don't want it added to the world file.
Back to top
View user's profile Send private message
The Doctor
Moderator
Moderator


Joined: 27 Jul 2010
Posts: 2678

PostPosted: Sun Sep 10, 2017 1:22 am    Post subject: Reply with quote

As Saboya said, writing such a tool is impossible in principle. When you write software you may add libs for your project, for example.

Fortunately there is an easy way to clean the file, but be warned that it may break things if you are careless. Move the /var/lib/portage/world file to a safe backup location. Do NOT edit the file! Run emerge -pc Note the -p!

emerge --noreplace <foo> <bar> every user selected package that appears and you want to keep. For example, emerge --noreplace kde-meta but not kactivitymanager or plasma-desktop

Do it in small bites and leave out everything you are unsure of until latter. The end of the process should be a list of packages that you don't want or don't recognize. These will probably be mostly libraries. Let depclean take care of those. Run emerge -auvND world just to be perfectly safe.
_________________
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
Dragonlord
Guru
Guru


Joined: 22 Aug 2004
Posts: 446
Location: Switzerland

PostPosted: Sun Sep 10, 2017 2:04 am    Post subject: Reply with quote

That sounds horribly complicated and error prone to say the least. Furthermore it's anything else but user friendly. The logic I had in mind is a lot simpler. I don't see why this logic doesn't work.
_________________
DragonDreams: Leader and Head Programmer
Back to top
View user's profile Send private message
ct85711
Veteran
Veteran


Joined: 27 Sep 2005
Posts: 1791

PostPosted: Sun Sep 10, 2017 2:38 am    Post subject: Reply with quote

The reason that this logic doesn't work, is how do you tell if some library is something you want or not? For all purposes, there is no way for the computer to if something in the world file is something you need/want. The most the computer can do is determine if something is a dependency of something else or not. Take for example, plasma-meta or gnome-base/gnome; 2 meta packages that provides everything, but often isn't a dependency. How is a computer (with no user input) is suppose to know it is needed. It will it is not needed, and remove them; which will cause everything else to get removed. This is why, there is no way for a program to do this, as it has no way telling.
Back to top
View user's profile Send private message
Jaglover
Watchman
Watchman


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

PostPosted: Sun Sep 10, 2017 3:49 am    Post subject: Reply with quote

My tool has been vim, just deleted everything that does not belong there. Over the years I got into habit to use -1 with emerge, so my world file stays clean. I see no danger editing it manually.
_________________
My Gentoo installation notes.
Please learn how to denote units correctly!
Back to top
View user's profile Send private message
saboya
Guru
Guru


Joined: 28 Nov 2006
Posts: 552
Location: Brazil

PostPosted: Sun Sep 10, 2017 4:31 am    Post subject: Reply with quote

What I can recommend is that it's a lot easier to manage sets. Usually you emerge something for a purpose, so you can create "purpose sets" and add apps to the set and just emerge -uavDN @world.

I have @dev, @media, @gui, @games, @gcc6, @basic-apps-gui, stuff like that. So I just emerge @media and I know all my media-related packages are there, and whenever something related to that changes, I remove/add them to the set and just emerge -uavDN @world / emerge --depclean.

(Actually I usually add them to the set and emerge -1 <PACKAGE> since it's faster, but you get the idea).
Back to top
View user's profile Send private message
The Doctor
Moderator
Moderator


Joined: 27 Jul 2010
Posts: 2678

PostPosted: Sun Sep 10, 2017 4:41 am    Post subject: Reply with quote

Jaglover wrote:
I see no danger editing it manually.
If you mess up the formatting by adding a line break, space, etc. portage will be unable to parse the file. A rather embarrassing situation. emerge --deselect and emerge --select where made to safely delete or add lines.
_________________
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
The Doctor
Moderator
Moderator


Joined: 27 Jul 2010
Posts: 2678

PostPosted: Sun Sep 10, 2017 4:52 am    Post subject: Reply with quote

Actually, the problem with the proposed world cleaner utility is that if you have libfoo-2.4 in your world file and libfoo-3.5 installed it may not identify libfoo-2.4 as extra since nothing depends on it anymore. Worse, libbar was added to world but orphaned so nothing depends on it either. These orphaned libraries are usually what cause problems and are impossible to detect using a tool.

The get rid of world and rebuild it approach is actually very easy to use since it is self critiquing. It takes maybe a half hour, tops.
_________________
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
Jaglover
Watchman
Watchman


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

PostPosted: Sun Sep 10, 2017 5:36 am    Post subject: Reply with quote

The Doctor wrote:
Jaglover wrote:
I see no danger editing it manually.
If you mess up the formatting by adding a line break, space, etc. portage will be unable to parse the file. A rather embarrassing situation. emerge --deselect and emerge --select where made to safely delete or add lines.

Never happened to me, and if it happened who forbids me to fix it?
_________________
My Gentoo installation notes.
Please learn how to denote units correctly!
Back to top
View user's profile Send private message
Dragonlord
Guru
Guru


Joined: 22 Aug 2004
Posts: 446
Location: Switzerland

PostPosted: Sun Sep 10, 2017 11:44 am    Post subject: Reply with quote

saboya wrote:
What I can recommend is that it's a lot easier to manage sets. Usually you emerge something for a purpose, so you can create "purpose sets" and add apps to the set and just emerge -uavDN @world.

I have @dev, @media, @gui, @games, @gcc6, @basic-apps-gui, stuff like that. So I just emerge @media and I know all my media-related packages are there, and whenever something related to that changes, I remove/add them to the set and just emerge -uavDN @world / emerge --depclean.

(Actually I usually add them to the set and emerge -1 <PACKAGE> since it's faster, but you get the idea).


Never heard of sets. What is this and what is it supposed to help? They main problem I ran into had been with KDE type packages turning into a mud-festival going from one major update to the next. I spend an entire afternoon fixing the message it made with the world file.
_________________
DragonDreams: Leader and Head Programmer
Back to top
View user's profile Send private message
jonathan183
Guru
Guru


Joined: 13 Dec 2011
Posts: 318

PostPosted: Sun Sep 10, 2017 12:45 pm    Post subject: Reply with quote

charles17 wrote:
See https://wiki.gentoo.org/wiki/World_set_%28Portage%29#Keep_it_clean


+1 qdepends gets you a shortlist of packages to consider
Back to top
View user's profile Send private message
charles17
Advocate
Advocate


Joined: 02 Mar 2008
Posts: 3664

PostPosted: Sun Sep 10, 2017 2:04 pm    Post subject: Reply with quote

Dragonlord wrote:
Never heard of sets. What is this and what is it supposed to help?

See https://wiki.gentoo.org/wiki//etc/portage/sets#External_resources.
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