Gentoo Websites Logo
Go to: Gentoo Home Documentation Forums Lists Bugs Planet Store Wiki Get Gentoo!
Bug 828059 - sys-apps/portage: Handling of conflicting package names is counterintuitive
Summary: sys-apps/portage: Handling of conflicting package names is counterintuitive
Alias: None
Product: Portage Development
Classification: Unclassified
Component: Core - Interface (emerge) (show other bugs)
Hardware: All Linux
: Normal normal (vote)
Assignee: Portage team
Depends on:
Reported: 2021-12-03 07:18 UTC by Michał Górny
Modified: 2021-12-04 04:56 UTC (History)
0 users

See Also:
Package list:
Runtime testing required: ---


Note You need to log in before you can comment on or make changes to this bug.
Description Michał Górny archtester Gentoo Infrastructure gentoo-dev Security 2021-12-03 07:18:32 UTC
Currently, when:

- multiple packages have different categories and the same name

- but only one of them is installed

then the emerge prefers the one that is installed rather than displaying the conflict.

For example, if I 'emerge zstd':

- if neither of the packages are installed, or both, it will display an ambiguity message

- but if app-arch/zstd is installed, it will try to rebuild it without warning

In my opinion, this behavior is not only confusing but makes very little sense.  After all, how often do users actually want to rebuild or upgrade some individual package manually (vs via @world upgrade)?  I think it's more common for 'emerge zstd' to be used to actually install something new.
Comment 1 Mike Gilbert gentoo-dev 2021-12-03 16:55:52 UTC
It might make sense to check installed packages when performing an unmerge action (emerge --unmerge or emerge --depclean).
Comment 2 Michał Górny archtester Gentoo Infrastructure gentoo-dev Security 2021-12-03 17:23:34 UTC
From what I've seen, package matching for uninstall is handled separately.
Comment 3 Larry the Git Cow gentoo-dev 2021-12-04 04:56:35 UTC
The bug has been referenced in the following commit(s):

commit f85f0991a90b17009e02d342c58fb5b066d7b0c9
Author:     Michał Górny <>
AuthorDate: 2021-12-03 07:27:18 +0000
Commit:     Michał Górny <>
CommitDate: 2021-12-04 04:56:20 +0000

    emerge: Do not resolve ambiguous package names via installed pkgs
    When dealing with ambiguous package names on command-line, do not use
    installed packages to resolve them.  This is counterintuitive
    in the best case, and probably the wrong answer most of the time.
    After all, if a user calls emerge with a specific package name, it is
    quite likely that he intends to install a missing package rather than
    rebuild or upgrade an individual package (though the latter can also
    happen).  Rather than making assumptions that can go wrong, just display
    the ambiguity message as usual.
    Signed-off-by: Michał Górny <>

 lib/_emerge/ | 15 ---------------
 1 file changed, 15 deletions(-)