[Date Prev][Date Next] [Thread Prev][Thread Next] [Date Index] [Thread Index]

Re: aptitude or apt-get: how to use the jolly character?



In <[🔎] 878wkcdobs.fsf@gmail.com>, Rodolfo Medina wrote:
>Suppose that I want to remove all the packages beginning with `texlive',
> that are a lot in my system.
>
>If I do: `aptitude purge texlive*', the system complains that no package
> has that name.

Right, the shell performs "globbing", matching such patterns against 
pathnames and providing multiple arguments to the underlying command.  As 
packages aren't accessible via pathnames, you can't count on your shell 
finding them.

>How to do then?

Aptitude itself uses regular expressions (I like PCRE, might just be posix-
extended) to match against package properties paired with "atoms" or 
"operators" (I can't remember the correct terminology) to select which 
property or combine searches.

In this case use the aptitude search string "~n^texlive" or simply 
"^texlive" since "~n" is the default.

Since these aptitude search expressions can have characters in them that the 
shell interprets (e.g. *, ?, and [] all have special meaning in both regular 
expressions and shell "glob"s), you'll want to surround the expression in 
single-quotes to prevent the shell from interpreting it -- passing it 
directly to aptitude after removing the quotes.

Something like:
aptitude purge '^texlive'
-- 
Boyd Stephen Smith Jr.           	 ,= ,-_-. =.
bss@iguanasuicide.net            	((_/)o o(\_))
ICQ: 514984 YM/AIM: DaTwinkDaddy 	 `-'(. .)`-'
http://iguanasuicide.net/        	     \_/

Attachment: signature.asc
Description: This is a digitally signed message part.


Reply to: