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: 19,739

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
Sometimes it is the people no one can imagine anything of who do the things no one can imagine. -- Alan Turing
---
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: 19,739

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
Sometimes it is the people no one can imagine anything of who do the things no one can imagine. -- Alan Turing
---
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,424
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
Member
From: Netherlands, Europe
Registered: 2005-10-04
Posts: 11,868

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.


(A works at time B)  && (time C > time B ) ≠  (A works at time C)

Offline

Board footer

Powered by FluxBB