Gentoo Forums
Gentoo Forums
Gentoo Forums
Quick Search: in
Removing unused dependencies
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
Barabbas
n00b
n00b


Joined: 30 Oct 2008
Posts: 6

PostPosted: Thu Oct 30, 2008 9:23 am    Post subject: Removing unused dependencies Reply with quote

I want to clean my system from unused stuff, but dont know which packages are safe to remove, and which are still needed as a dependency (direct/indirect) for some other program.

Is there a prefered way to see this or do I have to do it manually (and how :? )?


Also, what is the way to list all packages that are installed on a computer (everything in world, and everything installed automaticaly by emerge)?
Back to top
View user's profile Send private message
cjubon
Guru
Guru


Joined: 03 Jul 2007
Posts: 450
Location: Vienna/Europe

PostPosted: Thu Oct 30, 2008 10:41 am    Post subject: Reply with quote

Quote:
I want to clean my system from unused stuff, but dont know which packages are safe to remove, and which are still needed as a dependency (direct/indirect) for some other program.

Is there a prefered way to see this

Code:
emerge -av --depclean
You might want to clean your /var/lib/portage/world file first, and to run revdep-rebuild after emerge depclean.
_________________
Mandrake Dec 2001 · Debian "Woody" Aug 2002 · Gentoo Jan 2004 · Funtoo Oct 2009
Back to top
View user's profile Send private message
swimmer
Veteran
Veteran


Joined: 15 Jul 2002
Posts: 1330
Location: Netherlands

PostPosted: Thu Oct 30, 2008 11:05 am    Post subject: Reply with quote

And the warning when running 'emerge --depclean' recommends
Code:
emerge --update --newuse --deep world
*before* executing 'emerge --depclean -av' ...

HTH
swimmer
Back to top
View user's profile Send private message
notHerbert
Advocate
Advocate


Joined: 11 Mar 2008
Posts: 2228
Location: 45N 73W

PostPosted: Thu Oct 30, 2008 2:36 pm    Post subject: Reply with quote

... and revdep-rebuild after.



EDIT: Oops!


Last edited by notHerbert on Thu Oct 30, 2008 4:22 pm; edited 1 time in total
Back to top
View user's profile Send private message
swimmer
Veteran
Veteran


Joined: 15 Jul 2002
Posts: 1330
Location: Netherlands

PostPosted: Thu Oct 30, 2008 3:06 pm    Post subject: Reply with quote

notHerbert wrote:
... and revdep-rebuild after.
Of course, but this was mentioned already ;-)
Back to top
View user's profile Send private message
swimmer
Veteran
Veteran


Joined: 15 Jul 2002
Posts: 1330
Location: Netherlands

PostPosted: Thu Oct 30, 2008 3:14 pm    Post subject: Reply with quote

I use btw. since more than 1 year this script to maintain my systems and I am more than satisfied with it ...

HTH
swimmer
Back to top
View user's profile Send private message
aliquid
n00b
n00b


Joined: 14 Mar 2008
Posts: 37

PostPosted: Thu Oct 30, 2008 5:27 pm    Post subject: Reply with quote

If you want to remove even more packages than emerge --depclean does, you can try:
Code:
emerge -av --depclean --with-bdeps n
Back to top
View user's profile Send private message
FaeLLe
n00b
n00b


Joined: 13 Aug 2007
Posts: 13
Location: London

PostPosted: Mon Jun 16, 2014 4:11 pm    Post subject: Reply with quote

aliquid wrote:
If you want to remove even more packages than emerge --depclean does, you can try:
Code:
emerge -av --depclean --with-bdeps n


Can someone peer review this command please?
It wanted to remove so many more packages than the usual command - emerge -av --depclean
Back to top
View user's profile Send private message
ct85711
Veteran
Veteran


Joined: 27 Sep 2005
Posts: 1791

PostPosted: Mon Jun 16, 2014 6:04 pm    Post subject: Reply with quote

Well, with-bdeps is meaning build time dependency's that are not strictly required to run the program. Here's the info from emerge's man page reguarding this command:

Code:

--with-bdeps < y | n >
              In  dependency  calculations,  pull  in  build  time  dependencies  that are not
              strictly required. This defaults to ´n´ for installation actions,  meaning  they
              will  not be installed, and ´y´ for the --depclean action, meaning they will not
              be removed.  This setting can be added to EMERGE_DEFAULT_OPTS (see make.conf(5))
              and later overridden via the command line.


So, in short bdeps is grabbing packages that are only needed to build a package, and is NOT installed by default, so it shouldn't need to remove anything additional either. This is assuming you did not change the default setttings for this to begin with. So personaly, I would be extra cautious on what additional packages "--with-bdeps n" wants to also remove, as I would think it's removing something that may not be safe to remove. Of course, like everyone else has mentioned, do run revdep-rebuild afterwards to ensure nothing was broken. It is also a good idea, to just go through the list that depclean wants to remove before hand too (I usualy do -pv instead of -a myself).

Another command, that I like to use too, is "equery depends ***" from gentoolkit to see what packages depends on it (adding a -D will also list indirect dependencies too).

Overall, it just depends on how much do you want to clean off your system. Overall, it's pretty safe to just do 'emerge -av --depclean' by it's self; and I've rarely have anything break from that (a couple packages, emerge ended up reinstalling all over again for something else, just to be removed on the next depclean; but everything still ran perfectly fine). Now days, portage is getting pretty good, in there is very little in breakages (the only breakages I encounter anymore is usualy updating perl) everything else portage handles ahead of time, to prevent the breakages (this is not including packages that don't compile, as that's a whole different thing).
Back to top
View user's profile Send private message
NeddySeagoon
Administrator
Administrator


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

PostPosted: Mon Jun 16, 2014 6:31 pm    Post subject: Reply with quote

FaeLLe,

--with-bdeps=n will remove packages only needed to build other packages.

This is probably a waste as they will be reinstalled next time they are needed, for example, as you update.
_________________
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
FaeLLe
n00b
n00b


Joined: 13 Aug 2007
Posts: 13
Location: London

PostPosted: Tue Jun 17, 2014 7:04 am    Post subject: Reply with quote

Thanks everyone :)
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