How to completely uninstall everything installed by the last pacman -S command? (I goofed.)

tl;dr I made the mistake of installing pamac-cli, and accidentally hitting enter instead of cancelling, so it installed ~500 MB of GUI packages that I don’t need at all on Manjaro Minimal.

How do I blast all these out? I want to uninstall `pamac-cli’ and everything that was installed when I executed the command.

I looked at the wiki page at pacman - ArchWiki, but didn’t see exactly what I needed.

EDIT 2: I’ve not run this command, but I did almost run it, and I’m confused because it’s not showing me any of the dependencies that were installed.

]$ sudo pacman -Rsun pamac-cli
checking dependencies…

Packages (1) pamac-cli-10.1.3-3

Total Removed Size: 0.19 MiB

:: Do you want to remove these packages? [Y/n] n

EDIT 1: It installed all this. I know I can just remove them individually, but there MUST be an easier way.

> Packages (100) adobe-source-code-pro-fonts-2.038ro+1.058it+1.018var-1  adwaita-icon-theme-40.1.1-1  alsa-card-profiles-1:0.3.33-1  alsa-lib-1.2.5.1-3  alsa-topology-conf-1.2.5.1-1  alsa-ucm-conf-1.2.5.1-1  apparmor-3.0.3-1  appstream-glib-0.7.18-3
>                at-spi2-atk-2.38.0-1  at-spi2-core-2.40.3-1  atk-2.36.0-1  avahi-0.8+20+gd1e71b3-1  brotli-1.0.9-4  bubblewrap-0.4.1-2  cantarell-fonts-1:0.301-1  dbus-glib-0.112-2  dconf-0.40.0-1  desktop-file-utils-0.26-1  flac-1.3.3-3  flatpak-1.11.2-1
>                gcab-1.4-1  gcr-3.40.0-1  geoclue-2.5.7-3  geocode-glib-3.26.2-1  glib-networking-1:2.68.1-1  gnome-desktop-1:40.3-1  gnome-keyring-1:40.0-1  gsettings-desktop-schemas-40.0-3  gtk-update-icon-cache-1:4.2.1-2  gtk3-1:3.24.30-2
>                hicolor-icon-theme-0.17-2  iso-codes-4.6.0-1  js78-78.13.0-1  json-glib-1.6.4-1  lcms2-2.12-1  libasyncns-0.8+3+g68cd5af-3  libcanberra-0.30+2+gc0620e4-5  libcloudproviders-0.3.1-2  libcolord-1.4.5-4  libcups-1:2.3.3op2-3  libdaemon-0.14-5
>                libepoxy-1.5.9-1  libfdk-aac-2.0.2-1  libfreeaptx-0.1.1-1  libglvnd-1.3.3-1  libice-1.0.10-3  libldac-2.0.2.3-1  libmm-glib-1.16.10-1  libogg-1.3.5-1  libomxil-bellagio-0.9.3-3  libpamac-11.0.1-2  libproxy-0.4.17-2  libpulse-15.0-1
>                librsvg-2:2.50.7-1  libsm-1.2.3-2  libsndfile-1.0.31-1  libsodium-1.0.18-2  libsoup-2.72.0+10+gfe1e295d-1  libstemmer-2.1.0-1  libunwind-1.5.0-1  libvorbis-1.3.7-2  libxcomposite-0.4.5-3  libxcursor-1.2.0-2  libxdamage-1.1.5-3
>                libxfixes-6.0.0-1  libxi-1.7.10-3  libxinerama-1.1.4-3  libxkbcommon-1.3.0-1  libxrandr-1.5.2-3  libxshmfence-1.3-2  libxtst-1.2.3-4  libxxf86vm-1.1.4-4  libyaml-0.2.5-1  llvm-libs-12.0.1-3  mesa-21.1.6-1  opus-1.3.1-2  ostree-2021.3-1
>                pipewire-1:0.3.33-1  polkit-0.119-1  rest-0.8.1-3  rtkit-0.13-1  sbc-1.5-2  snapd-2.51.5-1  snapd-glib-1.59-1  sound-theme-freedesktop-0.8-4  speex-1.2.0-3  speexdsp-1.2.0-2  squashfs-tools-4.5-1  tdb-1.4.5-1  vulkan-icd-loader-1.2.186-1
>                wayland-1.19.0-1  wayland-protocols-1.21-1  webrtc-audio-processing-0.3.1-3  xdg-dbus-proxy-0.1.2-3  xdg-desktop-portal-1.8.1-1  xdg-desktop-portal-gtk-1.8.0-1  xkeyboard-config-2.33-1  libpamac-flatpak-plugin-11.0.1-2
>                libpamac-snap-plugin-11.0.1-2  pamac-cli-10.1.3-3

Are you sure installing pamac-cli installed all of those “extra” packages…? Or did it just update your system?

A lot of those packages literally have nothing to do with pamac-cli (I believe). Installing anything on Manjaro should always be also updating all of your current packages to avoid partial upgrades.

Also, maybe you also have pamac-gtk installed, so you’ll need to uninstall both:

sudo pacman -Rns pamac-cli pamac-gtk

I’m running Manjaro minimal. Xorg isn’t even installed.

So, yes, I’m sure. :slight_smile: The list I added to my original post is everything it installed. That was not a system update.

It installed Wayland, for some reason. At least it didn’t install X.

sudo pacman -Syu pamac-cli
:: Synchronizing package databases...
 core is up to date
 extra is up to date
 community is up to date
:: Starting full system upgrade...
resolving dependencies...
looking for conflicting packages...
warning: dependency cycle detected:
warning: libglvnd will be installed before its mesa dependency

Packages (73) adobe-source-code-pro-fonts-2.038ro+1.058it+1.018var-1  adwaita-icon-theme-40.1.1-1  alsa-lib-1.2.5.1-3  alsa-topology-conf-1.2.5.1-1  alsa-ucm-conf-1.2.5.1-1  appstream-glib-0.7.18-3  at-spi2-atk-2.38.0-1  at-spi2-core-2.40.3-1
              atk-2.36.0-1  avahi-0.8+20+gd1e71b3-1  brotli-1.0.9-4  cantarell-fonts-1:0.301-1  dbus-glib-0.112-2  dconf-0.40.0-1  desktop-file-utils-0.26-1  flac-1.3.3-3  gcab-1.4-1  glib-networking-1:2.68.1-1  gsettings-desktop-schemas-40.0-3
              gtk-update-icon-cache-1:4.2.1-2  gtk3-1:3.24.30-2  hicolor-icon-theme-0.17-2  iso-codes-4.6.0-1  js78-78.13.0-1  json-glib-1.6.4-1  lcms2-2.12-1  libasyncns-0.8+3+g68cd5af-3  libcanberra-0.30+2+gc0620e4-5  libcloudproviders-0.3.1-2
              libcolord-1.4.5-4  libcups-1:2.3.3op2-3  libdaemon-0.14-5  libepoxy-1.5.9-1  libglvnd-1.3.3-1  libice-1.0.10-3  libogg-1.3.5-1  libomxil-bellagio-0.9.3-3  libpamac-11.0.1-2  libproxy-0.4.17-2  libpulse-15.0-1  librsvg-2:2.50.7-1
              libsm-1.2.3-2  libsndfile-1.0.31-1  libsoup-2.72.0+10+gfe1e295d-1  libstemmer-2.1.0-1  libunwind-1.5.0-1  libvorbis-1.3.7-2  libxcomposite-0.4.5-3  libxcursor-1.2.0-2  libxdamage-1.1.5-3  libxfixes-6.0.0-1  libxi-1.7.10-3
              libxinerama-1.1.4-3  libxkbcommon-1.3.0-1  libxrandr-1.5.2-3  libxshmfence-1.3-2  libxtst-1.2.3-4  libxxf86vm-1.1.4-4  libyaml-0.2.5-1  llvm-libs-12.0.1-3  mesa-21.1.6-1  opus-1.3.1-2  polkit-0.119-1  rest-0.8.1-3
              sound-theme-freedesktop-0.8-4  speex-1.2.0-3  speexdsp-1.2.0-2  tdb-1.4.5-1  vulkan-icd-loader-1.2.186-1  wayland-1.19.0-1  wayland-protocols-1.21-1  xkeyboard-config-2.33-1  pamac-cli-10.1.3-3

Total Download Size:    84.39 MiB
Total Installed Size:  388.37 MiB

EDIT:

~]$ sudo pacman -Rsun pamac-gtk
[sudo] password for $USER:
error: target not found: pamac-gtk

@realmain , unfortunately, it looks like that’s not installed. :frowning:

@Strit , is this the intended behavior when installing pamac-cli? I don’t understand why it installs an entire desktop environment. It lists Gnome as a dependency.

removing the original should orphen the rest, then remove those, so
sudo pacman -R pamac-cli
sudo pacman -Rs $(pacman -Qdtq)

1 Like

Thanks!

Any idea why it’s not automatically listing all the dependencies for deletion with a command like pacman -Rsun? I swear I used those flags to remove all dependencies of a package along with the package before, but it suddenly doesn’t seem to work anymore.

… This was not the result I expected.

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

Okay. I think I got it.

I possibly goofed up badly enough that I missed something, but this appears to have ripped out all the GUI-related packages.

Am I missing something?

~]$ sudo pacman -Rnsc wayland
checking dependencies...
:: gdk-pixbuf2 optionally requires librsvg: Load .svg, .svgz, and .svg.gz
:: git optionally requires org.freedesktop.secrets: keyring credential helper
:: libsecret optionally requires org.freedesktop.secrets: secret storage backend
:: pacman-mirrors optionally requires gtk3: for interactive mode (GUI)
:: pinentry optionally requires gcr: gnome3 backend
:: plymouth optionally requires cantarell-fonts: True Type support for BGRT theme
:: systemd optionally requires polkit: allow administration as unprivileged user
warning: dependency cycle detected:
warning: libglvnd will be removed after its mesa dependency

Packages (99) adobe-source-code-pro-fonts-2.038ro+1.058it+1.018var-1  adwaita-icon-theme-40.1.1-1  alsa-card-profiles-1:0.3.33-1  alsa-lib-1.2.5.1-3  alsa-topology-conf-1.2.5.1-1  alsa-ucm-conf-1.2.5.1-1  apparmor-3.0.3-1  appstream-glib-0.7.18-3
              at-spi2-atk-2.38.0-1  at-spi2-core-2.40.3-1  atk-2.36.0-1  avahi-0.8+20+gd1e71b3-1  brotli-1.0.9-4  bubblewrap-0.4.1-2  cantarell-fonts-1:0.301-1  dbus-glib-0.112-2  dconf-0.40.0-1  desktop-file-utils-0.26-1  flac-1.3.3-3  flatpak-1.11.2-1
              gcab-1.4-1  gcr-3.40.0-1  geoclue-2.5.7-3  geocode-glib-3.26.2-1  glib-networking-1:2.68.1-1  gnome-desktop-1:40.3-1  gnome-keyring-1:40.0-1  gsettings-desktop-schemas-40.0-3  gtk-update-icon-cache-1:4.2.1-2  gtk3-1:3.24.30-2
              hicolor-icon-theme-0.17-2  iso-codes-4.6.0-1  js78-78.13.0-1  json-glib-1.6.4-1  lcms2-2.12-1  libasyncns-0.8+3+g68cd5af-3  libcanberra-0.30+2+gc0620e4-5  libcloudproviders-0.3.1-2  libcolord-1.4.5-4  libcups-1:2.3.3op2-3  libdaemon-0.14-5
              libepoxy-1.5.9-1  libfdk-aac-2.0.2-1  libfreeaptx-0.1.1-1  libglvnd-1.3.3-1  libice-1.0.10-3  libldac-2.0.2.3-1  libmm-glib-1.16.10-1  libogg-1.3.5-1  libomxil-bellagio-0.9.3-3  libpamac-11.0.1-2  libpamac-flatpak-plugin-11.0.1-2
              libpamac-snap-plugin-11.0.1-2  libproxy-0.4.17-2  libpulse-15.0-1  librsvg-2:2.50.7-1  libsm-1.2.3-2  libsndfile-1.0.31-1  libsodium-1.0.18-2  libsoup-2.72.0+10+gfe1e295d-1  libstemmer-2.1.0-1  libunwind-1.5.0-1  libvorbis-1.3.7-2
              libxcomposite-0.4.5-3  libxcursor-1.2.0-2  libxdamage-1.1.5-3  libxfixes-6.0.0-1  libxi-1.7.10-3  libxinerama-1.1.4-3  libxkbcommon-1.3.0-1  libxrandr-1.5.2-3  libxshmfence-1.3-2  libxtst-1.2.3-4  libxxf86vm-1.1.4-4  libyaml-0.2.5-1
              llvm-libs-12.0.1-3  mesa-21.1.6-1  opus-1.3.1-2  ostree-2021.3-1  pipewire-1:0.3.33-1  polkit-0.119-1  rest-0.8.1-3  rtkit-0.13-1  sbc-1.5-2  snapd-2.51.5-1  snapd-glib-1.59-1  sound-theme-freedesktop-0.8-4  speex-1.2.0-3  speexdsp-1.2.0-2
              squashfs-tools-4.5-1  tdb-1.4.5-1  vulkan-icd-loader-1.2.186-1  wayland-protocols-1.21-1  webrtc-audio-processing-0.3.1-3  xdg-dbus-proxy-0.1.2-3  xdg-desktop-portal-1.8.1-1  xdg-desktop-portal-gtk-1.8.0-1  xkeyboard-config-2.33-1
              wayland-1.19.0-1

Total Removed Size:  500.85 MiB

I’m not sure what happened on your end.

Pamac-cli depends on libpamac, which depends on gtk3.
When I do sudo pacman -S pamac-cli on a minimal system, I don’t get gnome-desktop in my list of packages to be installed.

[manjaro@quartz64 ~]$ sudo pacman -S pamac-cli
[sudo] password for manjaro: 
resolving dependencies...
looking for conflicting packages...
warning: dependency cycle detected:
warning: libglvnd will be installed before its mesa dependency

Packages (72) adobe-source-code-pro-fonts-2.038ro+1.058it+1.018var-1  adwaita-icon-theme-40.1.1-1  appstream-glib-0.7.18-3  at-spi2-atk-2.38.0-1  at-spi2-core-2.40.3-1  atk-2.36.0-1  avahi-0.8+20+gd1e71b3-1  brotli-1.0.9-4  cantarell-fonts-1:0.301-1  dbus-glib-0.112-2  dconf-0.40.0-1  desktop-file-utils-0.26-1  flac-1.3.3-3  gcab-1.4-1
              glib-networking-1:2.68.1-1  gsettings-desktop-schemas-40.0-3  gtk-update-icon-cache-1:4.4.0-1  gtk3-1:3.24.30-2  hicolor-icon-theme-0.17-2  iso-codes-4.6.0-1  js78-78.13.0-1  json-glib-1.6.6-1  lcms2-2.12-1  libasyncns-0.8+3+g68cd5af-3  libcanberra-0.30+2+gc0620e4-5  libcloudproviders-0.3.1-2  libcolord-1.4.5-4  libcups-1:2.3.3op2-3
              libdaemon-0.14-5  libepoxy-1.5.9-1  libglvnd-1.3.3-1  libice-1.0.10-3  libogg-1.3.5-1  libomxil-bellagio-0.9.3-3  libpamac-11.0.1-2  libproxy-0.4.17-2  libpulse-15.0-1  librsvg-2:2.50.7-1  libsm-1.2.3-2  libsndfile-1.0.31-1  libsoup-2.74.0-1  libstemmer-2.1.0-1  libtool-2.4.6+42+gb88cebd5-15  libunwind-1.5.0-1  libvorbis-1.3.7-2
              libxcomposite-0.4.5-3  libxcursor-1.2.0-2  libxdamage-1.1.5-3  libxfixes-6.0.0-1  libxi-1.7.10-3  libxinerama-1.1.4-3  libxkbcommon-1.3.0-1  libxrandr-1.5.2-3  libxshmfence-1.3-2  libxtst-1.2.3-4  libxxf86vm-1.1.4-4  libyaml-0.2.5-1  llvm-libs-12.0.1-3  lm_sensors-1:3.6.0.r41.g31d1f125-1  mesa-21.2.1-1.1  opus-1.3.1-2  polkit-0.119-1
              rest-0.8.1-3  sound-theme-freedesktop-0.8-4  speex-1.2.0-3  speexdsp-1.2.0-2  tdb-1.4.5-1  vulkan-icd-loader-1.2.187-1  wayland-1.19.0-1  wayland-protocols-1.21-1  xkeyboard-config-2.33-1  pamac-cli-10.1.3-3

Total Download Size:    84.76 MiB
Total Installed Size:  389.94 MiB

:: Proceed with installation? [Y/n] n

I do get gtk3 and wayland, because gtk3 is a dependency of libpamac and wayland is a dependency of gtk3.

That is an interesting set of dependencies for a -cli package, more like what I would expect for pamac-gtk.

1 Like

Hm. I was wrong.

The pamac pkgbase depends on gtk3.

Thanks, @Strit . I’m not sure what I did.

I also installed the flatpak and snap add-ons, which might have somehow gotten me gnome. ¯_(ツ)_/¯