You are not logged in.

#1 2025-04-09 14:12:28

atomikegg
Member
Registered: 2019-08-14
Posts: 128

Redundant Orphan Removal?

The wiki offers this command to remove orphans
# pacman -Qdtq | pacman -Rns -

and this command to remove "more unneeded packages (dependency cycles, excessive dependencies (fulfilled more than once), some non-explicit optionals etc.)"
$ pacman -Qqd | pacman -Rsu -

Question: Is there any overlap between these two commands? Will the second one remove everything the first one removes?

https://wiki.archlinux.org/title/Pacman … _(orphans)

Offline

#2 2025-04-09 14:23:10

tekstryder
Member
Registered: 2013-02-14
Posts: 298

Re: Redundant Orphan Removal?

atomikegg wrote:

$ pacman -Qqd | pacman -Rsu -

You've a typo there.

Offline

#3 2025-04-12 14:29:16

Nikolai5
Member
From: North West, England, UK
Registered: 2024-01-27
Posts: 228

Re: Redundant Orphan Removal?

You can test the output of the first one by just running:

pacman -Qdt

You can test the output of the second one with

pacman -Qqd | pacman -Rsu --print -

You can then compare what packages its going to remove.

I tend to only run

pacman -Rns $(pacman -Qqdt)

to remove oprhans, for me that other command includes some packages that I want to keep, though you could argue that means I should mark them as explicitly installed instead.


Desktop: Ryzen 7 1800X | AMD 7800XT | KDE Plasma
MacbookPro-2012 | XFCE

Offline

#4 2025-04-12 16:50:39

tekstryder
Member
Registered: 2013-02-14
Posts: 298

Re: Redundant Orphan Removal?

tekstryder wrote:

You've a typo there.

No typo. Disregard. This thread inspired me to perform a little housekeeping with my morning tea.

I'd previously been A-okay with -Qdt returning an empty set. I wasn't living my best life.

Nikolai5 wrote:

that means I should mark them as explicitly installed instead.

In most cases. Or remove them. Or mark parent deps as explicit rather.

In a couple of cases pacman -Qqd | pacman -Rsu --print - returned mulitple optional dependencies such as

libcupsfilters
qpdf
qpdf
└─libcupsfilters
  ├─cups-filters
  │ └─cups
  └─libppd
    └─cups-filters

   
Reinstalling the parent (cups) as explicit cleared both packages from the list while allowing them to remain as installed as a dependency.

Ditto for qemu-desktop. I'd had a veritable slew of qemu-* packages listed (likely from the packaging split a while back). Simply reinstalling qemu-desktop as explicit cleared them all up instead of marking ~20 pkgs individually.

These all now return nothing:

✔ pacman -Qdt
✔ pacman -Qdtt
✔ pacman -Qqd | pacman -Rsu --print -

And I removed a small bit of cruft.

I still have my original 2006 first-ever Arch install on my laptop.

Dare I engage in such neurosis there? Another day perhaps.

Offline

Board footer

Powered by FluxBB