Bjoern Olausson

Remov deps. PDF Print E-mail
  
Friday, 09 November 2007 14:51
Removing Specific Dependencies

Have you ever installed something with a lot of dependencies? Have you ever wanted to remove that package along with all of its dependencies? Instinct may tell us that we can run emerge --depclean, however there is a different, perhaps better way.

Lets say that we want to compare OpenOffice.org and koffice. Our plan is to install both, try them out, and remove one of them. First, do:

  • Code Listing 2.1: Creating .deps files

# emerge openoffice -p | sed -ne  \ '/^\[ebuild[^]]*N[^]]*\]/{s/^\[ebuild[^]]\+\]\([^[:space:]]\+\).*$/=\1/;p}' \ > openoffice.deps

# emerge koffice-meta -p | sed -ne \
'/^\[ebuild[^]]*N[^]]*\]/{s/^\[ebuild[^]]\+\] \([^[:space:]]\+\).*$/=\1/;p}' \ > koffice.deps


This will ensure that we do not record any packages that are being updated. Proceed to install and try the programs. Once you chose which one you want to keep, simply do the following:

  • Code Listing 2.2: Removing unused package/dependencies

# emerge -aC $(<openoffice.deps)

 

This week's Tips and Tricks was inspired by the following posting on the forums:
http://forums.gentoo.org/viewtopic-t-531232.html


(taken from Gentoo Weekly Newsletter: 9 April 2007)

 

Add comment


Security code
Refresh