View previous topic :: View next topic |
Author |
Message |
Dragonlord Guru
Joined: 22 Aug 2004 Posts: 446 Location: Switzerland
|
Posted: Sat Sep 09, 2017 2:21 pm Post subject: World file cleaner tool? |
|
|
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 |
|
|
charles17 Advocate
Joined: 02 Mar 2008 Posts: 3664
|
|
Back to top |
|
|
saboya Guru
Joined: 28 Nov 2006 Posts: 552 Location: Brazil
|
Posted: Sat Sep 09, 2017 2:44 pm Post subject: |
|
|
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 |
|
|
The Doctor Moderator
Joined: 27 Jul 2010 Posts: 2678
|
Posted: Sun Sep 10, 2017 1:22 am Post subject: |
|
|
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 |
|
|
Dragonlord Guru
Joined: 22 Aug 2004 Posts: 446 Location: Switzerland
|
Posted: Sun Sep 10, 2017 2:04 am Post subject: |
|
|
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 |
|
|
ct85711 Veteran
Joined: 27 Sep 2005 Posts: 1791
|
Posted: Sun Sep 10, 2017 2:38 am Post subject: |
|
|
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 |
|
|
Jaglover Watchman
Joined: 29 May 2005 Posts: 8291 Location: Saint Amant, Acadiana
|
|
Back to top |
|
|
saboya Guru
Joined: 28 Nov 2006 Posts: 552 Location: Brazil
|
Posted: Sun Sep 10, 2017 4:31 am Post subject: |
|
|
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 |
|
|
The Doctor Moderator
Joined: 27 Jul 2010 Posts: 2678
|
Posted: Sun Sep 10, 2017 4:41 am Post subject: |
|
|
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 |
|
|
The Doctor Moderator
Joined: 27 Jul 2010 Posts: 2678
|
Posted: Sun Sep 10, 2017 4:52 am Post subject: |
|
|
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 |
|
|
Jaglover Watchman
Joined: 29 May 2005 Posts: 8291 Location: Saint Amant, Acadiana
|
Posted: Sun Sep 10, 2017 5:36 am Post subject: |
|
|
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 |
|
|
Dragonlord Guru
Joined: 22 Aug 2004 Posts: 446 Location: Switzerland
|
Posted: Sun Sep 10, 2017 11:44 am Post subject: |
|
|
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 |
|
|
jonathan183 Guru
Joined: 13 Dec 2011 Posts: 318
|
Posted: Sun Sep 10, 2017 12:45 pm Post subject: |
|
|
+1 qdepends gets you a shortlist of packages to consider |
|
Back to top |
|
|
charles17 Advocate
Joined: 02 Mar 2008 Posts: 3664
|
|
Back to top |
|
|
|