How to uninstall optional dependenices with pamac or pacman


During install new application via Pamac I founded that sometimes it has optional dependencies. Where I can select whether i want them to be installed or not.
But I noticed if I select to install optional dependencies during install application, and after that uninstall the “main” application, optional dependencies remain in the system.

In this case those dependencies clutter up the system.

How to protect from this?

Even it’s hard to remember all optional dependencies that were installed. Should i keep a diary?


I like to use sudo pacman -Rns PACKAGE
This will remove the package, saved content, and dependencies/optionaldeps that werent explicitly installed and/or are not a dependency of something else (ie - fullish but safe)
If you want to find a list of orphans then you can use something like
pacman -Qqdt
(but please inspect this list … it can contain packages you want to keep, even if they are orphans)


In addition to what @cscs said, you can remove orphaned dependencies at any time with

pamac remove -o

EDIT: not sure why remove is bold there


The code format or ticks ``` style seem to highlight/bold/color things randomly … I think its supposed to be smart syntax highlighting (that utterly fails in most cases … because it assumes pacman is java or something)


Hmmmm. Just try pamac remove -o

[webcapcha@webcapcha ~]$ pamac remove -o
Checking dependencies...
python-pyqt5 optionally requires qt5-declarative: QtQml, qmlplugin
To remove (11):
  kservice         5.54.0-1    extra
  kdbusaddons      5.54.0-1    extra
  kcrash           5.54.0-1    extra
  kwindowsystem    5.54.0-1    extra
  kconfigwidgets   5.54.0-1    extra
  kwidgetsaddons   5.54.0-1    extra
  ki18n            5.54.0-1    extra
  qt5-declarative  5.12.0-1    extra
  kguiaddons       5.54.0-1    extra
  kconfig          5.54.0-1    extra
  kcodecs          5.54.0-1    extra

Total removed size: 61.9 MB

As far as my system is pretty fresh. It has only 4 application except defaults. Why so many to remove?

Does it corresponding with stable update that i just finished?


If your avatar is correct and you are using XFCE … then yeah those probably arent needed
(they are all KDE or QT things)


Was one of the things you removed a kde application? It may have brought all those in as dependencies.


I’m pretty sure that not, except colord-kde which was an optional dependencies for displaycal application.


Well actually then yes, thats it … look at its deps:

extra-cmake-modules (make)
kcmutils (make)
kitemviews (make)
plasma-framework (make)

(plus the deps of those)


I’m so grateful to you guys.


Problem is, if you choose any optional dependencies from the prompt when installing a package via pamac, they’re explicitly installed.


didnt realize. [wakka wakka] . seems like a bug to me.


Sort of logical. I chose them, didn’t I?


Thing is, you only chose Program A because you wanted it installed for Program B. If you eventually uninstall Program B via pamac, Program A will be still be installed. It will not appear as an orphan so you may never realize you don’t need it anymore.


Isn’t the alternative that it will always be an orphan and it will removed every time you remove orphans?

I doubt that many people who use pacman install optional dependencies as dependencies.

split this topic #16

11 posts were split to a new topic: Signature is unknown trust


Right, but we were talking about how pamac handles optional dependencies.


My point is what pamac does is “normal” behavior.


My key is actualized and signed.

I have 3 keys active. So…

It means I will not be able to download any other software wich the location is in other host?

What I need to do with my manjaro 32 bits to activate the Manjaro engine, something like configuration of sources…

Or I need to keep original keys?


Please stop hijacking this thread. Your posts were moved here to your own thread: