Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[arch] Option to remove unnecessary dependencies #87

Closed
gobonja opened this issue Apr 17, 2020 · 16 comments
Closed

[arch] Option to remove unnecessary dependencies #87

gobonja opened this issue Apr 17, 2020 · 16 comments

Comments

@gobonja
Copy link

gobonja commented Apr 17, 2020

New 0.9.0 version is great, expecially arch repository support!

Is it possible to add pacman option for remove unnecessary dependencies when removing packages?

pacman -R [-s, --recursive]

This is currently only thing that keeps me from replacing pamac with bauh.

Thanks in advance

@vinifmor
Copy link
Owner

@gobonja do you mean an option to remove all unnecessary packages from the system ? The "uninstall" action was re-implemented for Arch packages in 0.9.0 and supports transitive dependencies exclusion.

uninstall

@gobonja
Copy link
Author

gobonja commented Apr 17, 2020

Installing e.g. xed also installs xed's dependencies (gspell, gtksourceview3, libpeas, xapps)
When bauh is removing packages, it uses command:
sudo -S pacman -R xed --noconfirm
which results in removing only xed
If you provide option to append -s or --recursive to pacman it will also remove xed's dependencies since they are not needed anymore.
sudo -S pacman -Rs xed --noconfirm or sudo -S pacman -R --recursive xed --noconfirm

sudo pacman -R xed
checking dependencies...

Packages (1) xed-2.4.1-1

Total Removed Size:  11,82 MiB

:: Do you want to remove these packages? [Y/n]
sudo pacman -Rs xed 
checking dependencies...
:: gtkd optionally requires gtksourceview3
:: gtkd optionally requires libpeas

Packages (5) gspell-1.8.3-1  gtksourceview3-3.24.11-1  libpeas-1.26.0-1  xapps-1.6.10-1  xed-2.4.1-1

Total Removed Size:  21,61 MiB

:: Do you want to remove these packages? [Y/n]

This of course shoudn't be default behavior but giving user option would be great.

@vinifmor
Copy link
Owner

In this latest version bauh removes all required, so the command would look like: pacman -R xed xapps gspell etc... --noconfirm. The optional required are ignored for the moment. But sure, it is a good add. I'm going to add this feature to the backlog log.

Cheers.

@vinifmor
Copy link
Owner

Added a behavior to uninstall that for related unneeded packages. You can try by installing bauh-staging (0.9.1.RC-1) from AUR. Let me know if it's working on your end.

uninstall_transient

The final release (0.9.1) should be available in the next days.

@gobonja
Copy link
Author

gobonja commented Apr 20, 2020

It doesn't seems to be working correctly (e.g. tilix and xed)
tilix -> gtkd, liblphobos - not removed
xed -> gspell, gtksourceview3, libpeas, xapps - not removed

I like your approach with keep and uninstall buttons.
However, clicking close button doesn't cancel operation so it's little confusing.
Also adding cancel next to the keep and uninstall would be great from user perspective.

@gobonja
Copy link
Author

gobonja commented Apr 20, 2020

I don't know how are you getting list of dependencies to be removed, but you can get list without version number by running:
pacman -Rs --print-format=%n xed

Parameter --print-format implies --print so it will only print the targets instead of performing the actual operation (sync, remove or upgrade).

@vinifmor
Copy link
Owner

The close button would be "X" ?

I'm going to review those cases you mentioned. Thanks for the tip regarding the pacman simulation command

@vinifmor vinifmor added in review and removed done labels Apr 21, 2020
@gobonja
Copy link
Author

gobonja commented Apr 21, 2020

Yes, it is X button.

@vinifmor
Copy link
Owner

vinifmor commented Apr 22, 2020

@gobonja , I've fixed the behavior. Please, try the new RC from bauh-staging and let me know if it works on your end.

uninstall_transient_2

@gobonja
Copy link
Author

gobonja commented Apr 23, 2020

It appears that there are still some issues.
Few examples:
removing tilix -> leaves liblphobos
removing deepin-screenshot -> leaves: libqtxdg, dtkwidget, deepin-qt-dbus-factory, dtkcore, gsettings-qt, deepin-qt5dxcb-plugin

@vinifmor
Copy link
Owner

could you check if these dependencies are not required by other packages ?

@gobonja
Copy link
Author

gobonja commented Apr 23, 2020

Yes, I checked. Those packages are removed when running run:
sudo pacman -Rs deepin-screenshot

Also I noticed that packages are installed with:
sudo -S pacman -S libqtxdg deepin-qt5integration deepin-qt-dbus-factory deepin-qt5dxcb-plugin dtkwidget deepin-turbo dtkwm dtkcore gsettings-qt deepin-screenshot --noconfirm

Doing so marks packages:
Install Reason : Explicitly installed

Which means that running:
sudo pacman -Rs --print-format=%n package_name
won't list that packages.

Installing dependency with --asdeps will mark them as:
Install Reason : Installed as a dependency for another package

@vinifmor
Copy link
Owner

Indeed... but there is a reason for that. There are some packages that have malformed pkgbuilds and put some mutual dependent packages... for such cases if a install command is executed before with all dependencies, the wished package ends up being installed as a dependency of a dependency.If you use pacman's interactive mode, it sorts this out. But this subject could be another thread :). I'm going to review these cases you have mentioned.

@vinifmor
Copy link
Owner

@gobonja , it seems fixed now. I've published a new RC to bauh-staging (RC-4).

First bauh will ask the user to select the main dependencies not required by the package:

uninstall_transient_3

After the wanted are selected, bauh will check their dependencies trees and displays everything that will be removed:

uninstall_transient_4

Let me know if its working now. Thank you for helping me to test this feature.

@gobonja
Copy link
Author

gobonja commented Apr 24, 2020

Works like a charm!

Thank you for listening to the users and implementing this feature.

@vinifmor vinifmor mentioned this issue Apr 24, 2020
@vinifmor
Copy link
Owner

No worries. The final release (0.9.1) is already available. I'm going to close this issue.

Cheers

@vinifmor vinifmor added done and removed in review labels Apr 24, 2020
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

2 participants