Ask question about pacman commands

Hello,

I try to find equivalent commands from Archlinux/Manjaro to Fedora.

Can you tell me the equivalent of these commands or what they can do on Manjaro/ArchLinux ?:

  1. pacman -Qoq

  2. pacman -Rpc

I ask you this question because one of the user here make a script called “cinnamon-remove-application” for Manjaro Cinnamon and I want to port it to Fedora Cinnamon. So I try to find an equivalent for these two commands on Fedora (with dnf).

Thanks a lot.

Regards.

AlanP.

See here:
https://wiki.archlinux.org/title/Pacman/Rosetta

2 Likes

Will search the database of installed packages for packages that own a filename, and print only the names of the packages.

$ pacman -Qoq /usr/bin/xev
xorg-xev
QUERY OPTIONS (APPLY TO -Q)
      -o, --owns <file>
           Search for packages that own the specified file(s). The path can be relative or absolute, and one or more files can be specified

      -q, --quiet
           Show less information for certain query operations. This is useful when pacman’s output is processed in a script. Search will only show package names and not version, group, and description information; owns will only show package names instead of "file is
           owned by pkg" messages; group will only show package names and omit group names; list will only show files and omit package names; check will only show pairs of package names and missing files; a bare query will only show package names rather than names and
           versions.

It will recursively list the names and versions of all installed target packages, and all installed packages that depend on them (which themselves become targets and the process is repeated until nothing remains).

$ pacman -Rpc meld                                                                                                                       
my-universal-manjaro-update-helper-2.1-1
meld-3.22.3-1

In this case my-universal-manjaro-update-helper depends on meld, if something depended on my-universal-manjaro-update-helper then that would also be listed, and so on.

TRANSACTION OPTIONS (APPLY TO -S, -R AND -U)
       -p, --print
           Only print the targets instead of performing the actual operation (sync, remove or upgrade). Use --print-format to specify how targets are displayed. The default format string is "%l", which displays URLs with -S, file names with -U, and pkgname-pkgver with
           -R.

REMOVE OPTIONS (APPLY TO -R)
       -c, --cascade
           Remove all target packages, as well as all packages that depend on one or more target packages. This operation is recursive and must be used with care, since it can remove many potentially needed packages.
1 Like

-Q queries database, -o for orphans (not needed).

Fedora you’d use dnf. for ‘-Q’ it’s ‘repoquery’ and you want ‘–unneeded’.

So again, to remove a package and dependencies - dnf remove package. To remove the rest, use dnf autoremove package.

Very straightforward once you get the hang of a websearch (I never used fedora…)

Your question:

Can you tell me the equivalent of these commands or what they can do on Manjaro/ArchLinux ?:

I suggest you use FISH in your terminal. If you don’t have it, then install it now and switch by typing ‘fish’.

Then type…

pacman -TAB

❯ pacman -Qg 
-Qb                          (Alternate database location)
-Qc                       (View the change log of PACKAGE)
-Qd       (List only non-explicit packages (dependencies))
-Qe              (List only explicitly installed packages)
-Qg               (Display members of [all] package GROUP)
-Qh                                         (Display help)
-Qi              (View PACKAGE [backup files] information)
-Qk                       (Check that PACKAGE files exist)
-Ql                      (List the files owned by PACKAGE)
-Qm   (List installed packages not found in sync database)
-Qn  (list installed packages only found in sync database)
-Qo                     (Query the package that owns FILE)
-Qp         (Query a package file instead of the database)
-Qq                                (Show less information)
-Qr                          (Alternate installation root)
-Qs         (Search locally-installed packages for regexp)
-Qt       (List only unrequired packages [and optdepends])
-Qu                       (List only out-of-date packages)
-QV                             (Display version and exit)
-Qv                          (Output more status messages)

However, rather than relying on scripts to remove packages it would be rather less complicated to simply remember just a few commands.

FISH will also work in Fedora.

I’ll just keep this simple; you like simplicity, right?

And, at the risk of being a :parrot:

Regards.

2 Likes