Gentoo Websites Logo
Go to: Gentoo Home Documentation Forums Lists Bugs Planet Store Wiki Get Gentoo!

Bug 915149

Summary: app-editors/emacs 29 won't uninstall
Product: Gentoo Linux Reporter: dbarrett
Component: Current packagesAssignee: Gentoo Linux bug wranglers <bug-wranglers>
Status: RESOLVED DUPLICATE    
Severity: normal    
Priority: Normal    
Version: unspecified   
Hardware: All   
OS: Linux   
Whiteboard:
Package list:
Runtime testing required: ---

Description dbarrett 2023-10-03 22:35:29 UTC
On a freshly installed Gentoo 2.13 system, I ran these commands to install my first package:

$ cat /etc/gentoo-release
Gentoo Base System release 2.13
$ sudo emaint -a sync
$ sudo emerge app-editors/emacs

Then I immediately tried to uninstall the same package, and it failed. That seems unexpected. Perhaps it's a bug?

$ sudo emerge -cav app-editors/emacs

Calculating dependencies... done!
  app-editors/emacs-29.1-r1 pulled in by:
    app-emacs/emacs-common-1.9 requires >=app-editors/emacs-23.1:*

>>> No packages selected for removal by depclean
Comment 1 sanomiad 2023-10-04 03:16:05 UTC
First, try:

# emerge --deselect app-editors/emacs

then: 

# emerge -cav app-editors/emacs
Comment 2 dbarrett 2023-10-04 03:24:36 UTC
Thanks for the suggestion. Here is what happened:

$ sudo emerge --deselect app-editors/emacs
Password: 
>>> Removing app-editors/emacs from "world" favorites file...
$ sudo emerge -cav app-editors/emacs

Calculating dependencies... done!
  app-editors/emacs-29.1-r1 pulled in by:
    app-emacs/emacs-common-1.9 requires >=app-editors/emacs-23.1:*

>>> No packages selected for removal by depclean
$
Comment 3 sanomiad 2023-10-04 04:05:12 UTC
(In reply to dbarrett from comment #2)
> Thanks for the suggestion. Here is what happened:
> 
> $ sudo emerge --deselect app-editors/emacs
> Password: 
> >>> Removing app-editors/emacs from "world" favorites file...
> $ sudo emerge -cav app-editors/emacs
> 
> Calculating dependencies... done!
>   app-editors/emacs-29.1-r1 pulled in by:
>     app-emacs/emacs-common-1.9 requires >=app-editors/emacs-23.1:*
> 
> >>> No packages selected for removal by depclean
> $

You need to do the same for emacs-common:

$ sudo emerge --deselect app-editors/emacs app-emacs/emacs-common

(no need to supply the package you want to remove, emerge will take care of that)

$ sudo emerge -cav
Comment 4 dbarrett 2023-10-04 10:12:08 UTC
Thank you. So if I install a package (like app-editors/emacs), and it pulls in dependencies (like app-emacs/emacs-common), the only way to uninstall the package is to list all dependencies by name on the command line?

If emacs had pulled in 30 dependencies, all 30 of them would need to be listed explicitly on the --deselect line?
Comment 5 Joakim Tjernlund 2023-10-04 10:38:51 UTC
(In reply to dbarrett from comment #4)
> Thank you. So if I install a package (like app-editors/emacs), and it pulls
> in dependencies (like app-emacs/emacs-common), the only way to uninstall the
> package is to list all dependencies by name on the command line?
> 
> If emacs had pulled in 30 dependencies, all 30 of them would need to be
> listed explicitly on the --deselect line?

you can after deinstalling emacs run emerge --depclean
Comment 6 dbarrett 2023-10-04 11:07:26 UTC
Thank you Joakim, but that's not quite what I am asking.

In my original example, app-editors/emacs had one dependency (app-emacs/emacs-common) that was blocking its removal. The solution was to --deselect it manually. But what if app-editors/emacs had 30 dependencies that are blocking its removal, instead of just app-emacs/emacs-common? Would all 30 dependencies need to be named on the command line, like I did with app-emacs/emacs-common? Or is there a magic command that means, "Please remove emacs along with all 30 dependencies that are blocking its removal"? Thank you.
Comment 7 Sam James archtester Gentoo Infrastructure gentoo-dev Security 2023-10-04 11:19:53 UTC
(In reply to dbarrett from comment #6)
> Thank you Joakim, but that's not quite what I am asking.
> 
> In my original example, app-editors/emacs had one dependency
> (app-emacs/emacs-common) that was blocking its removal. The solution was to
> --deselect it manually. But what if app-editors/emacs had 30 dependencies
> that are blocking its removal, instead of just app-emacs/emacs-common? Would
> all 30 dependencies need to be named on the command line, like I did with
> app-emacs/emacs-common? Or is there a magic command that means, "Please
> remove emacs along with all 30 dependencies that are blocking its removal"?
> Thank you.

You're right, yes.

For now, you have two choices:
1) emerge --depclean (global depclean, you should do this regularly after world upgrades anyway)
2) emerge --depclean a b ... (for each explicit dependency you think could be removed)

But you are right that we need some command for this recursive removal, see bug 416907.

*** This bug has been marked as a duplicate of bug 416907 ***