Cleaning up Manjaro

Is this command similar to the command in Debian
sudo apt-get autoremove

sudo pacman -R $(pacman -Qtdq)

Hi @MAYBL8,

I recommend you rather use pamac instead of pacman, and the command then would be:

pamac remove --orphans

Hope this helps!

I get this when running these commands:

[demo@manjaro Downloads]$ sudo pacman -R $(pacman -Qtdq)
checking dependencies...

Packages (78) autoconf-archive-1:2022.09.03-1  bison-3.8.2-4  boost-1.80.0-2  coffeescript-2.7.0-1  cpio-2.13-2  cunit-2.1.3-3  ddcutil-1.3.0-1  docbook2x-0.8.8-18
              electron-20.0.3-2  electron16-16.2.8-2  extra-cmake-modules-5.98.0-1  fcgi-2.4.2-2  flex-2.6.4-3  fmt-9.1.0-1  gdb-12.1-1  go-2:1.19.1-1  gperf-3.1-3
              gperftools-2.10-1  gtest-1.12.1-1  icon-naming-utils-0.8.90-5  js78-78.15.0-4  junit-4.13.2-1  leveldb-1.23-3  lib32-pcre-8.45-3  lib32-readline-8.1.002-1
              libcmis-0.5.2-12  libcroco-0.6.13-2  libgit2-1:1.5.0-1  libkipi-22.04.0-1  libmaxminddb-1.7.1-1  libofa-0.9.3-9  librabbitmq-c-0.11.0-1  librdkafka-1.9.2-1
              libvips-8.13.1-2  numactl-2.0.16-1  pkgconf-1.8.0-1  plasma-wayland-protocols-1.9.0-1  python-bcrypt-4.0.0-1  python-build-0.8.0-2
              python-cachecontrol-1:0.12.11-1  python-cherrypy-18.8.0-1  python-contextlib2-21.6.0-1  python-dateutil-2.8.2-4  python-defusedxml-0.7.1-4
              python-distutils-extra-2.39-10  python-elasticsearch-7.9.0-1  python-flask-restful-0.3.9-3  python-google-api-python-client-2.60.0-1  python-installer-0.5.1-1
              python-isodate-0.6.1-1  python-mock-3.0.5-9  python-nose-1.3.7-14  python-nspektr-0.4.0-2  python-pecan-1.4.2-1  python-pkgconfig-1.5.5-3
              python-prettytable-3.4.1-1  python-progress-1.6-5  python-prometheus_client-0.14.1-1  python-pycodestyle-2.9.1-2  python-pyjwt-2.5.0-1  python-pytest-cov-4.0.0-1
              python-resolvelib-0.8.1-1  python-retrying-1.3.3-13  python-rich-12.6.0-1  python-scikit-learn-1.1.2-1  python-sphinx-5.2.3-1  python-tenacity-8.1.0-1
              python-xmlsec-1.3.13-1  rabbitmq-3.10.7-1  valgrind-3.19.0-5  vte3-0.68.0-2  xapp-2.2.15-1  xmlstarlet-1.6.1-3  xorg-server-xvfb-21.1.4-1  yaml-cpp-0.7.0-2
              yarn-1.22.19-1  yasm-1.3.0-5  yq-3.1.0-1

Total Removed Size:  1358.15 MiB

:: Do you want to remove these packages? [Y/n] n
[demo@manjaro Downloads]$ uname -a
Linux manjaro 5.19.11-1-MANJARO #1 SMP PREEMPT_DYNAMIC Fri Sep 23 14:31:33 UTC 2022 x86_64 GNU/Linux
[demo@manjaro Downloads]$ pamac remove --orphans
Preparing...
Checking dependencies...

To remove (153):
  python-nose                           1.3.7-14                                                      extra
  icon-naming-utils                     0.8.90-5                                                      extra
  perl-xml-simple                       2.25-7          (Orphan Of: icon-naming-utils)                extra
  python-cachecontrol                   1:0.12.11-1                                                   community
  python-msgpack                        1.0.4-1         (Orphan Of: python-cachecontrol)              community
  python-isodate                        0.6.1-1                                                       community
  python-pyjwt                          2.5.0-1                                                       community
  gtest                                 1.12.1-1                                                      community
  yaml-cpp                              0.7.0-2                                                       community
  python-bcrypt                         4.0.0-1                                                       community
  rabbitmq                              3.10.7-1                                                      community
  erlang-nox                            25.1-1          (Orphan Of: rabbitmq)                         community
  librdkafka                            1.9.2-1                                                       community
  yq                                    3.1.0-1                                                       community
  python-xmltodict                      0.13.0-2        (Orphan Of: yq)                               community
  python-argcomplete                    2.0.0-1         (Orphan Of: yq)                               community
  python-scikit-learn                   1.1.2-1                                                       community
  python-scipy                          1.9.1-1         (Orphan Of: python-scikit-learn)              community
  python-threadpoolctl                  3.1.0-1         (Orphan Of: python-scikit-learn)              community
  python-joblib                         1.2.0-1         (Orphan Of: python-scikit-learn)              community
  libcroco                              0.6.13-2                                                      extra
  python-cherrypy                       18.8.0-1                                                      community
  python-cheroot                        8.6.0-2         (Orphan Of: python-cherrypy)                  community
  python-jaraco.collections             3.5.1-3         (Orphan Of: python-cherrypy)                  community
  python-jaraco.classes                 3.2.3-1         (Orphan Of: python-cherrypy)                  community
  python-portend                        3.1.0-1         (Orphan Of: python-cherrypy)                  community
  python-tempora                        5.0.2-1         (Orphan Of: python-cherrypy)                  community
  python-zc.lockfile                    2.0-8           (Orphan Of: python-cherrypy)                  community
  fcgi                                  2.4.2-2                                                       extra
  librabbitmq-c                         0.11.0-1                                                      community
  python-distutils-extra                2.39-10                                                       community
  intltool                              0.51.0-6        (Orphan Of: python-distutils-extra)           extra
  python-google-api-python-client       2.60.0-1                                                      community
  python-google-api-core                2.10.0-1        (Orphan Of: python-google-api-python-client)  community
  python-googleapis-common-protos       1.56.4-1        (Orphan Of: python-google-api-python-client)  community
  python-protobuf                       21.7-1          (Orphan Of: python-google-api-python-client)  extra
  python-google-auth-httplib2           0.1.0-3         (Orphan Of: python-google-api-python-client)  community
  python-google-auth                    2.3.2-1         (Orphan Of: python-google-api-python-client)  community
  python-cachetools                     5.2.0-1         (Orphan Of: python-google-api-python-client)  community
  python-rsa                            4.9-1           (Orphan Of: python-google-api-python-client)  community
  python-pyasn1-modules                 0.2.8-6         (Orphan Of: python-google-api-python-client)  extra
  python-pyasn1                         0.4.8-7         (Orphan Of: python-google-api-python-client)  extra
  python-uritemplate                    4.1.1-1         (Orphan Of: python-google-api-python-client)  community
  cunit                                 2.1.3-3                                                       community
  coffeescript                          2.7.0-1                                                       community
  python-pycodestyle                    2.9.1-2                                                       community
  junit                                 4.13.2-1                                                      extra
  java-hamcrest                         1.3-5           (Orphan Of: junit)                            extra
  libvips                               8.13.1-2                                                      community
  libcgif                               0.3.0-1         (Orphan Of: libvips)                          community
  plasma-wayland-protocols              1.9.0-1                                                       extra
  valgrind                              3.19.0-5                                                      extra
  python-elasticsearch                  7.9.0-1                                                       community
  docbook2x                             0.8.8-18                                                      community
  perl-xml-sax-expat                    0.51-7          (Orphan Of: docbook2x)                        community
  perl-sgmls                            1:1.1-9         (Orphan Of: docbook2x)                        community
  openjade                              1.3.2-7         (Orphan Of: docbook2x)                        extra
  opensp                                1.5.2-9         (Orphan Of: docbook2x)                        extra
  sgml-common                           0.6.3-8         (Orphan Of: docbook2x)                        extra
  libgit2                               1:1.5.0-1                                                     extra
  http-parser                           2.9.4-1         (Orphan Of: libgit2)                          extra
  python-tenacity                       8.1.0-1                                                       community
  python-progress                       1.6-5                                                         community
  libkipi                               22.04.0-1                                                     
  xorg-server-xvfb                      21.1.4-1                                                      extra
  bison                                 3.8.2-4                                                       core
  python-pytest-cov                     4.0.0-1                                                       community
  python-coverage                       6.2-1           (Orphan Of: python-pytest-cov)                community
  python-pytest                         7.1.3-1         (Orphan Of: python-pytest-cov)                community
  python-pluggy                         1.0.0-1         (Orphan Of: python-pytest-cov)                community
  python-py                             1.11.0-1        (Orphan Of: python-pytest-cov)                community
  python-iniconfig                      1.1.1-5         (Orphan Of: python-pytest-cov)                community
  python-apipkg                         3.0.1-1         (Orphan Of: python-pytest-cov)                community
  python-attrs                          22.1.0-1        (Orphan Of: python-pytest-cov)                extra
  libcmis                               0.5.2-12                                                      extra
  python-nspektr                        0.4.0-2                                                       extra
  lib32-readline                        8.1.002-1                                                     multilib
  python-installer                      0.5.1-1                                                       community
  python-pkgconfig                      1.5.5-3                                                       community
  extra-cmake-modules                   5.98.0-1                                                      extra
  cmake                                 3.24.2-1        (Orphan Of: extra-cmake-modules)              extra
  jsoncpp                               1.9.5-2         (Orphan Of: extra-cmake-modules)              extra
  rhash                                 1.4.2-1         (Orphan Of: extra-cmake-modules)              extra
  pkgconf                               1.8.0-1                                                       core
  yarn                                  1.22.19-1                                                     community
  electron                              20.0.3-2                                                      community
  gperftools                            2.10-1                                                        extra
  python-flask-restful                  0.3.9-3                                                       community
  python-flask                          2.2.2-1         (Orphan Of: python-flask-restful)             community
  python-werkzeug                       2.2.2-1         (Orphan Of: python-flask-restful)             community
  python-itsdangerous                   2.1.2-2         (Orphan Of: python-flask-restful)             community
  python-click                          8.1.3-1         (Orphan Of: python-flask-restful)             community
  python-aniso8601                      9.0.1-3         (Orphan Of: python-flask-restful)             community
  libofa                                0.9.3-9                                                       extra
  xmlstarlet                            1.6.1-3                                                       community
  python-prometheus_client              0.14.1-1                                                      extra
  libmaxminddb                          1.7.1-1                                                       community
  leveldb                               1.23-3                                                        community
  python-defusedxml                     0.7.1-4                                                       extra
  vte3                                  0.68.0-2                                                      extra
  vte-common                            0.68.0-2        (Orphan Of: vte3)                             extra
  gdb                                   12.1-1                                                        extra
  source-highlight                      3.1.9-9         (Orphan Of: gdb)                              extra
  gdb-common                            12.1-1          (Orphan Of: gdb)                              extra
  electron16                            16.2.8-2                                                      
  gperf                                 3.1-3                                                         extra
  python-build                          0.8.0-2                                                       community
  python-pep517                         0.13.0-1        (Orphan Of: python-build)                     extra
  flex                                  2.6.4-3                                                       core
  numactl                               2.0.16-1                                                      extra
  fmt                                   9.1.0-1                                                       extra
  python-pecan                          1.4.2-1                                                       community
  python-mako                           1.2.3-1         (Orphan Of: python-pecan)                     extra
  python-logutils                       0.3.5-10        (Orphan Of: python-pecan)                     community
  python-webtest                        3.0.0-3         (Orphan Of: python-pecan)                     community
  python-webob                          1.8.7-4         (Orphan Of: python-pecan)                     community
  python-waitress                       2.1.2-1         (Orphan Of: python-pecan)                     community
  cpio                                  2.13-2                                                        extra
  python-contextlib2                    21.6.0-1                                                      community
  xapp                                  2.2.15-1                                                      community
  libgnomekbd                           1:3.28.1-1      (Orphan Of: xapp)                             extra
  libxklavier                           5.4-3           (Orphan Of: xapp)                             extra
  ddcutil                               1.3.0-1                                                       extra
  i2c-tools                             4.3-3           (Orphan Of: ddcutil)                          community
  go                                    2:1.19.1-1                                                    community
  python-rich                           12.6.0-1                                                      community
  python-commonmark                     0.9.1-5         (Orphan Of: python-rich)                      community
  python-future                         0.18.2-7        (Orphan Of: python-rich)                      community
  python-dateutil                       2.8.2-4                                                       community
  yasm                                  1.3.0-5                                                       extra
  autoconf-archive                      1:2022.09.03-1                                                community
  autoconf                              2.71-1          (Orphan Of: autoconf-archive)                 core
  m4                                    1.4.19-1        (Orphan Of: autoconf-archive)                 core
  python-resolvelib                     0.8.1-1                                                       extra
  python-mock                           3.0.5-9                                                       community
  python-pbr                            5.10.0-1        (Orphan Of: python-mock)                      community
  python-xmlsec                         1.3.13-1                                                      community
  python-retrying                       1.3.3-13                                                      extra
  python-sphinx                         5.2.3-1                                                       community
  python-sphinxcontrib-htmlhelp         2.0.0-5         (Orphan Of: python-sphinx)                    community
  python-sphinxcontrib-devhelp          1.0.2-9         (Orphan Of: python-sphinx)                    community
  python-sphinxcontrib-serializinghtml  1.1.5-4         (Orphan Of: python-sphinx)                    community
  python-imagesize                      1.4.1-2         (Orphan Of: python-sphinx)                    community
  python-snowballstemmer                2.2.0-3         (Orphan Of: python-sphinx)                    community
  python-sphinx-alabaster-theme         0.7.12-9        (Orphan Of: python-sphinx)                    community
  python-sphinxcontrib-applehelp        1.0.2-9         (Orphan Of: python-sphinx)                    community
  python-sphinxcontrib-qthelp           1.0.3-9         (Orphan Of: python-sphinx)                    community
  python-sphinxcontrib-jsmath           1.0.1-12        (Orphan Of: python-sphinx)                    community
  boost                                 1.80.0-2                                                      extra
  js78                                  78.15.0-4                                                     community
  python-prettytable                    3.4.1-1                                                       community
  python-wcwidth                        0.2.5-6         (Orphan Of: python-prettytable)               community
  lib32-pcre                            8.45-3                                                        multilib

Total removed size: 1.7 GB


I don’t know about the pacman one, but I think the difference is due to the fact that pacman doesn’t know, care, or worry about AUR packages, while pamac does. I’ve personally used that command many times, with no ill effects.

I got the info from this article:
https://gist.github.com/rumansaleem/083187292632f5a7cbb4beee82fa5031

Yes.

Those instructions are for Arch Linux, so they’ll probably work for Manjaro too. But they use pacman, not pamac as described above.

Well, now it’s up to you to choose… :balance_scale:

Some random info from some random article that has been created 3 years ago or some trustworthy info directly from the heart of the Manjaro community.

The discrepancy in total packages to be removed by pacman vs pamac originates in pacman only removing the packages you told it to remove (no cascade/recursion) vs pamac removing with cascade or recursion (can’t remember which one).
A 2nd run with that pacman command probably will remove further packages not needed anymore and not explicitly installed.

No I will listen to the Manjaro community. That is why I am here.
I get it but sometimes I don’t know how to ask the question properly and do a google search to find the answer first before I come here.
Thanks for your help in guiding me in the right direction.

1 Like

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