Sunday, April 28, 2024
 Popular · Latest · Hot · Upcoming
42
rated 0 times [  42] [ 0]  / answers: 1 / hits: 43920  / 3 Years ago, mon, may 10, 2021, 8:26:40

I want to uninstall libreoffice. This program consists of about three dozen modules. Ideally, they could be removed with:



aptitude remove libreoffice3.6* libreoffice-debian-menus libobasis3.6-*


but that fails with



Couldn't find any package whose name or description matched "libreoffice3.6*"


etc.



How do I delete a set of packages by pattern?



PS: I'm happy about answers with use dpkg or apt, too


More From » apt

 Answers
6

  1. Use apt-get, not aptitude, and use regular expressions.


  2. In a regular expression, . mean any character, and * means zero or more times. So the expression libreoffice.* matches any package name containing the string libreoffice, followed by any number of characters.


  3. Surround the regular expression with single quotes to avoid the shell interpreting the asterisk. (If you had a file named libreoffice.example for example in your current directory, the shell would replace libreoffice.* with libreoffice.example, so you have to use single quotes to stop this behaviour.)




Result:



sudo apt-get remove 'libreoffice.*'

[#31895] Tuesday, May 11, 2021, 3 Years  [reply] [flag answer]
Only authorized users can answer the question. Please sign in first, or register a free account.
calronze

Total Points: 0
Total Questions: 110
Total Answers: 112

Location: Belarus
Member since Thu, Aug 11, 2022
2 Years ago
calronze questions
Sun, Jan 9, 22, 13:41, 2 Years ago
Wed, Feb 15, 23, 01:41, 1 Year ago
Sat, Jul 23, 22, 21:03, 2 Years ago
Sat, Feb 5, 22, 01:57, 2 Years ago
;