You are not logged in.

#1 2021-06-07 20:47:28

damonh
Member
From: Uruguay
Registered: 2017-12-20
Posts: 6

How to remove packages using wildcard

Hello!

I was trying to remove GIMP and all its plugins using a wildcard like this:

sudo pacman -Rns gimp*

but it fails with the error:

zsh: no matches found: gimp*

I also tried

sudo pacman -Rns "gimp*"
error: target not found: gimp*
sudo pacman -Rns 'gimp*'
error: target not found: gimp*
sudo pacman -Rns gimp
checking dependencies...
error: failed to prepare transaction (could not satisfy dependencies)
:: removing gimp breaks dependency 'gimp' required by gimp-plugin-fblur
:: removing gimp breaks dependency 'gimp>=2.8' required by gimp-plugin-resynthesizer
:: removing gimp breaks dependency 'gimp>=2.3' required by gimp-plugin-saveforweb
:: removing gimp breaks dependency 'gimp' required by gimp-refocus
:: removing gimp breaks dependency 'gimp' required by xsane-gimp

How can I issue a command to remove all gimp[whatever] packages?

Thank you in advance.

--
Damon H.


--
Damon H. {uy}

Offline

#2 2021-06-07 21:04:38

ewaller
Administrator
From: Pasadena, CA
Registered: 2009-07-13
Posts: 20,701

Re: How to remove packages using wildcard

Look at the output of pacman -Qsq gimp and see if it lists a rational set of packages.  If it looks correct, then...

sudo pacman -Rs $(pacman -Qsq gimp)


Nothing is too wonderful to be true, if it be consistent with the laws of nature -- Michael Faraday
The shortest way to ruin a country is to give power to demagogues.— Dionysius of Halicarnassus
---
How to Ask Questions the Smart Way

Offline

#3 2021-06-07 21:25:31

tucuxi
Member
From: Switzerland
Registered: 2020-03-08
Posts: 291

Re: How to remove packages using wildcard

ewaller wrote:

If it looks correct, then...

That part is important as -Qs also matches text in the package description.

Perhaps to be on the safe side:

sudo pacman -Rsn $(pacman -Qsq gimp | grep gimp)

Offline

#4 2021-06-07 21:34:19

ewaller
Administrator
From: Pasadena, CA
Registered: 2009-07-13
Posts: 20,701

Re: How to remove packages using wildcard

Does -Qsq match the description?   I am not in fromt of my machine so I cannot check it right now.  If so, great catch!


Nothing is too wonderful to be true, if it be consistent with the laws of nature -- Michael Faraday
The shortest way to ruin a country is to give power to demagogues.— Dionysius of Halicarnassus
---
How to Ask Questions the Smart Way

Offline

#5 2021-06-07 21:37:12

jasonwryan
Anarchist
From: .nz
Registered: 2009-05-09
Posts: 30,426
Website

Re: How to remove packages using wildcard

man pacman wrote:

-s, --recursive
           Remove each target specified including all of their dependencies, provided that (A) they are not required by other packages; and
           (B) they were not explicitly installed by the user. This operation is recursive and analogous to a backwards --sync operation,
           and it helps keep a clean system without orphans. If you want to omit condition (B), pass this option twice.


Arch + dwm   •   Mercurial repos  •   Surfraw

Registered Linux User #482438

Offline

#6 2021-06-08 11:06:04

Lone_Wolf
Administrator
From: Netherlands, Europe
Registered: 2005-10-04
Posts: 15,426

Re: How to remove packages using wildcard

Or you could use a command like

pactree --reverse gimp # pactree comes with pacman-contrib

to figure out which packages to start the removal with and let pacman handle removing dependencies .


Disliking systemd intensely, but not satisfied with alternatives so focusing on taming systemd.

clean chroot building not flexible enough ?
Try clean chroot manager by graysky

Offline

#7 2026-09-21 18:48:07

erpage159
Member
Registered: 2026-09-21
Posts: 1

Re: How to remove packages using wildcard

ewaller wrote:

Look at the output of pacman -Qsq gimp and see if it lists a rational set of packages.  If it looks correct, then...

sudo pacman -Rs $(pacman -Qsq gimp)

For those that stumble upon this. In the case that there are packages in the list you don't want, you can redirect to a temp file, remove that with your editor. Then just use

sudo pacman -Rs $(cat /path/to/tmpfile)

Not the most elegant, but it's quick and gets it done.

Alternatively, you can just eyeball the list once, then pipe within the shell expanded part to sed with a list of lines/package names to blank out.

Figure this was probably implicit, but worth stating (was just removing vlc, but not playerctl and needed to look this up).

Offline

#8 2026-09-21 19:23:38

seth
Member
From: Won't reply 2 private help req
Registered: 2012-09-03
Posts: 77,913

Re: How to remove packages using wildcard

https://man.archlinux.org/man/vipe.1 but please don't necrobump.

Offline

#9 2026-09-21 19:54:08

Trilby
Inspector Parrot
Registered: 2011-11-29
Posts: 30,522
Website

Re: How to remove packages using wildcard

Also, given that all the plugins depend on gimp, this entire thread has been a red-herring of people troubleshooting the wild-card idea without ever questioning the underlying assumptions about that even being the proper way to go.  The relevant pacman flags are -Rc, e.g., `pacman -Rc gimp` optionally with 's' and 'n' as well, but not the double ss as that searches the wrong direction in the dependency tree for the present (aka ancient) goal.

Last edited by Trilby (2026-09-21 19:56:36)


"UNIX is simple and coherent" - Dennis Ritchie; "GNU's Not Unix" - Richard Stallman

Offline

#10 Yesterday 09:00:20

Lone_Wolf
Administrator
From: Netherlands, Europe
Registered: 2005-10-04
Posts: 15,426

Re: How to remove packages using wildcard

Moderator Note

Closing this old thread.


Disliking systemd intensely, but not satisfied with alternatives so focusing on taming systemd.

clean chroot building not flexible enough ?
Try clean chroot manager by graysky

Offline

Board footer

Powered by FluxBB