Hello, Eli.

On Mon, Feb 09, 2026 at 15:50:27 -0500, Eli Schwartz wrote:
> On 2/9/26 12:04 PM, Alan Mackenzie wrote:

> > It took me some while to work out what you meant by "installed",
> > especially given that the ebuild for php-8.2.28-r1 has been deleted
> > (from /usr/portage/dev-lang/php/...).  I think you mean that there is a
> > directory /var/db/pkg/dev-lang/php-8.2.28-r1, which is indeed the case.
> > 
> > [ Yes, I know /usr/portage is no longer the canonical place for ebuilds
> > to live, but this is a system from 2017, originally. ]
> > 
> > So emerge @preserved-rebuild is getting its information from
> > /var/db/pkg, it seems.
> > 
> > It is surely a bug that the ebuild can be removed from /usr/portage/...
> > whilst leaving that orphan directory in place under /var/db/....  It is
> > true that there is a second copy of the ebuild under /var/db/.... but
> > emerge doesn't look there for ebuilds.


> SIR!!!

> The package is installed because there is a file /usr/bin/php8.2
> installed, and it is *the package* that installed it.

I think it more the other way around.  The directory exists in /usr/bin
because the package is installed.  It's just the meaning of "package
installed" which I was trying to clarify.

> ebuilds are NOT packages. They are bash scripts describing how to build
> a package. Removing an ebuild from /usr/portage (2017) or /var/db/repos
> (new canonical place) removes the bash script describing how to build
> it. It does NOT remove /usr/bin/php8.2, that would be insane...

I spent quite a bit of yesterday evening trying to find where this is
explained in the docs.  I haven't found anything clearly outlining the
difference between ebuilds and packages, and the fact that the latter
can continue to exist after the deletion of the former.

> ... hence the package is installed, still.

Yes.

> /var/db/pkg is not "orphaned" nor is it a bug, it is the database of
> installed files etc.

The database of installed packages.  Yes, got that now, thanks.

> >> If you don't need this package and emerge -pvc shows nothing requiring
> >> it, maybe you can just remove it (e.g. with emerge -avc)?

> > I can't use emerge, because there's no ebuild for php-8.2.28-r1.  It's
> > looking as though I'll have to delete the directory under /var/db/... by
> > hand, together with all the associated files throughout the system.

> > Or, maybe if I let # USE='...' emerge =dev-lang/php-8.2.30 go ahead, it
> > will clear out the old directory in /var/db/...  Maybe.

> > Is this worth a bug report, or have I misunderstood something else?


> I already told you the same thing, though. My previous email:

I wasn't sure whether or not you were giving me a solution or a
workaround.  At that stage I hadn't yet understood what my problem was.
But I've now removed php-8.2.n entirely.

> >> I've cleaned up my orphan packages (most of them), but don't trust
> >> --depclean to do so.  It still wants to remove some packages I need and
> >> want to keep.

> > It will, by definition, remove packages not in world (emerge foobar
> > without --oneshot).

> > So, one must conclude you, for whatever reason, wished to oneshot these
> > packages and not add them to world.

No, that's not the case.  The particular package is daemontools, and I
most certainly didn't give it the -1 when installing.  Why would I?  It
got caught up in a portage mixup with the OpenRC's daemon handler.  This
is now fixed, but somehow daemontools hasn't made it into my @world.

This is just one isolated instance, but there might be more isolated
instances by which --depclean could render my system unbootable.  So,
like it itself directs, I always check very carefully the suggestions it
makes for removal.

> > This is your choice and your right, but it renders depclean ineffective.

As I say I don't trust --depclean.  I check its suggestions carefully,
then delete (some of) them by hand.  For example, I don't let it remove
older kernel packages, or older gcc versions.

> > You may run:

> > emerge --depclean php:8.2 --verbose

> > and due to verbose, it will tell you what package, if any, prevents
> > php:8.2 from being explicitly uninstalled.

> > Otherwise, seek out the rest of your orphaned packages.



> Please run:

> emerge --depclean php:8.2 --verbose

> as I asked.

The package is already gone, now that I understand it.

Thanks for all the help!

> -- 
> Eli Schwartz

-- 
Alan Mackenzie (Nuremberg, Germany).

Reply via email to