hasufell / portage-gentoo-git-config

Configuring portage to use the gentoo git mirrors and update relevant metadata
36 stars 13 forks source link

Handle dependencies removal #12

Closed ghost closed 9 years ago

ghost commented 9 years ago

Hello Julian,

Is there a way emerge to handle the removal of dependencies, because after reading it's man page I couldn't find anything that will solve the below scenario.

For example I have vlc and qbittorrent installed. Those programs among with several others depends on qt. Is there are a way to uninstall vlc along with it's dependencies, but to preserve the libraries and or frameworks that vlc came with, so the rest programs that depend on them won't be affected ? In case those dependecies are not used by any program/lib then to be removed.

Cheers

hasufell commented 9 years ago

emere --depclean <package> performs dependency resolution and will only uninstall stuff that is not needed by other packages

For general support, this is not the right place. Join #gentoo on freenode IRC or see the official gentoo wiki.

ghost commented 9 years ago

Hello Julian,

Thanks for the reply, appreciate your help.

Unfortunately neither the forum nor the irc channel support Tor users. Cannot register myself in the forum when using Tor, cannot even start the my IRC client because the Tor exit nodes are already blacklisted.

Didn't knew where or who to ask and had to drop by and open off-topic issue in one of your projects.

Here is what happens when I install and remove some random program without even bothering the USE flags.


~ > sudo emerge wpa_supplicant
Password: 
Calculating dependencies... done!
>>> Verifying ebuild manifests
>>> Emerging (1 of 6) net-wireless/wireless-regdb-20150605::gentoo
>>> Emerging (2 of 6) dev-libs/libnl-3.2.26::gentoo
>>> Emerging (3 of 6) dev-python/m2crypto-0.22.3-r4::gentoo
>>> Installing (1 of 6) net-wireless/wireless-regdb-20150605::gentoo
>>> Emerging (4 of 6) dev-qt/qtsvg-4.8.6-r1::gentoo
>>> Installing (3 of 6) dev-python/m2crypto-0.22.3-r4::gentoo
>>> Installing (2 of 6) dev-libs/libnl-3.2.26::gentoo
>>> Emerging (5 of 6) net-wireless/crda-1.1.3-r1::gentoo
>>> Installing (5 of 6) net-wireless/crda-1.1.3-r1::gentoo
>>> Installing (4 of 6) dev-qt/qtsvg-4.8.6-r1::gentoo
>>> Emerging (6 of 6) net-wireless/wpa_supplicant-2.4-r3::gentoo
>>> Installing (6 of 6) net-wireless/wpa_supplicant-2.4-r3::gentoo
>>> Recording net-wireless/wpa_supplicant in "world" favorites file...
>>> Jobs: 6 of 6 complete                           Load avg: 2.35, 1.01, 0.40

 * Messages for package net-wireless/wpa_supplicant-2.4-r3:

 * If this is a clean installation of wpa_supplicant, you
 * have to create a configuration file named
 * /etc/wpa_supplicant/wpa_supplicant.conf
 * 
 * An example configuration file is available for reference in
 * /usr/share/doc/wpa_supplicant-2.4-r3/
>>> Auto-cleaning packages...

>>> No outdated packages were found on your system.

 * GNU info directory index is up-to-date.

~ > sudo emerge --depclean wpa_supplicant

Calculating dependencies... done!
>>> Calculating removal order...

 net-wireless/wpa_supplicant
    selected: 2.4-r3 
   protected: none 
     omitted: none 

All selected packages: =net-wireless/wpa_supplicant-2.4-r3

>>> 'Selected' packages are slated for removal.
>>> 'Protected' and 'omitted' packages will not be removed.

>>> Waiting 5 seconds before starting...
>>> (Control-C to abort)...
>>> Unmerging in: 5 4 3 2 1
>>> Unmerging (1 of 1) net-wireless/wpa_supplicant-2.4-r3...
Packages installed:   689
Packages in world:    564
Packages in system:   44
Required packages:    689
Number removed:       1  <-----------------------------

Cheers

hasufell commented 9 years ago

To uninstall unused dependencies, just do emerge --depclean without any package name.

ghost commented 9 years ago

Hello Julian,

Thank you, that did the trick in combination with the following:


__emerge() { sudo emerge $@ ;}
orphans() { __emerge --ask --verbose --depclean ;}
rebuild() { __emerge --ask --update --deep --newuse --with-bdeps=y '@world' ;}

So in order to protect packages not to be removed all I have to do is --noreplace them, then run the rebuild function followed by the orphans function.

Thanks again. Without your help I wouldn't be able to solve it on my own.

Cheers