Dbus-units, systemd and pacman

the following

pacman -Qqd | pacman -Rsu --print -

give me the result

dbus-units-37-3

However, it is a dependency on systemd

What is correct ? Need it or need it not ?

Hi @weingeist,

DBus is, indeed, an important dependency. I strongly suspect you forgot the -t argument in the first pacman command, because:

-t, --unrequired
Restrict  or filter output to print only packages neither required nor
optionally required by any currently installed package.  Specify  this
option  twice  to  include  packages which are optionally, but not di‐
rectly, required by another package.

…and the command should actually be:

pacman -Qqdt | pacman -Rsu --print -
$ pacman -Qi dbus-units
Name            : dbus-broker-units
Version         : 37-3
Description     : Linux D-Bus Message Broker - Service units
 
Provides        : dbus-units
Depends On      : dbus  dbus-broker
 
Required By     : systemd
 
Packager        : Jan Alexander Steffens (heftig) <heftig@archlinux.org>
Build Date      : Sat 14 Feb 2026 14:59:16 GMT
Install Date    : Wed 18 Feb 2026 15:50:36 GMT
Install Reason  : Installed as a dependency for another package
$ sudo pacman -R dbus-broker

checking dependencies...
error: failed to prepare transaction (could not satisfy dependencies)
:: removing dbus-broker breaks dependency 'dbus-broker' required by dbus-broker-units

This command will list packages installed as a dependency in the short form.

Whether you should remove it or not depends on which package it has been installed as a dependency for.

The better question is - what are you trying to do?

If you are reading the best practise guide - it is safe

pacman -Qdtq | sudo pacman -Rns -
pacman -Qqd | sudo pacman -Rsu -

Do note the differences in the commands -Rns vs -Rsu where the -u is filtering the output to include only packages which are not needed.

pacman will never - on itself - remove a package that is required for the system to function.

The cmdline flags -Qqd will include packages which may be vital to the system - piping these to a pacman cmdline with -Rns will result in a message - no can do - whereas piping them to cmdline -Rsu will skip packages which are in fact needed.

My Question is the Result of

pacman -Qdtq | sudo pacman -Rns -
Fehler: Argument »-« mit leerer Standardeingabe angegeben

This happens because the first list generated by pacman -Qdtq is empty.

The same command can be executed like this and it would provide a more descriptive message - still the list is empty - no targets or packages specified.

 $ sudo pacman -Rns $(pacman -Qdtq)
error: no targets specified (use -h for help)

Okay, that makes sense.

Removing unused packages (orphans) - pacman/Tips and tricks - ArchWiki

For recursively removing orphans and their configuration files:

# pacman -Qdtq | pacman -Rns -

If no orphans were found, the output is error: argument '-' specified with empty stdin. This is expected as no arguments were passed to pacman -Rns

This topic was automatically closed 3 days after the last reply. New replies are no longer allowed.