You are not logged in.

#1 2012-06-04 14:55:04

m73
Member
Registered: 2012-06-04
Posts: 13

A simple way to remove a group except a specified package?

Hello. A new guy here, loving the distro. smile

So, what I did was installing openbox and then lxde to try out, but now I want to remove all lxde packages except openbox without removing each package individually.

I see on the man page that there is an option to exclude packages with a caret while syncing, but not while removing. Is there a simple way to do this?

Thank you.

Offline

#2 2012-06-04 15:01:12

Inxsible
Forum Fellow
From: Chicago
Registered: 2008-06-09
Posts: 9,183

Re: A simple way to remove a group except a specified package?

0) If you installed openbox explicitly before, it will not be listed as a dependency on lxde, you can safely remove lxde without affecting openbox. However, in case openbox was not installed explicitly, then see 1 or 2

1 ) remove and then re-install immediately ?

2) install openbox explicitly so that its no longer a dependency of lxde.

pacman -S openbox

and then remove lxde.


Forum Rules

There's no such thing as a stupid question, but there sure are a lot of inquisitive idiots !

Offline

#3 2012-06-04 15:27:06

m73
Member
Registered: 2012-06-04
Posts: 13

Re: A simple way to remove a group except a specified package?

I thought it might mess up my user configuration files, but I tried this and all is as was. Thanks. smile

Edit: Strange. I did install it explicitly before but uninstalling lxde still uninstalled openbox. But I reinstalled it so all good now.

Last edited by m73 (2012-06-04 15:31:39)

Offline

#4 2012-06-04 16:02:13

Awebb
Member
Registered: 2010-05-06
Posts: 6,688

Re: A simple way to remove a group except a specified package?

As a little tweak to Inxsible's idea, use

pacman -D --asexplicit

to change the status without reinstalling the package.

Offline

#5 2012-06-04 18:05:38

tomk
Forum Fellow
From: Ireland
Registered: 2004-07-21
Posts: 9,839

Re: A simple way to remove a group except a specified package?

This is about group membership, not explicitness. pacman always sees openbox as a member of the lxde group, even if it's installed without the rest of the group. So naturally, pacman will try to remove it with the group.

I guess this is either a feature or a bug, depending on your point of view. smile

Also, I know you're sorted now, but you could have done this:

pacman -R $(pacman -Qgq lxde | grep -v openbox)

Offline

#6 2012-06-04 19:16:19

Inxsible
Forum Fellow
From: Chicago
Registered: 2008-06-09
Posts: 9,183

Re: A simple way to remove a group except a specified package?

tomk wrote:

This is about group membership, not explicitness. pacman always sees openbox as a member of the lxde group, even if it's installed without the rest of the group. So naturally, pacman will try to remove it with the group.

I stand corrected on my point 0) then.

Hmm... I am not quite sure if I consider this a feature or a bug.... I am kinda on the fence on this one.


Forum Rules

There's no such thing as a stupid question, but there sure are a lot of inquisitive idiots !

Offline

#7 2012-06-04 19:55:14

m73
Member
Registered: 2012-06-04
Posts: 13

Re: A simple way to remove a group except a specified package?

tomk wrote:
pacman -R $(pacman -Qgq lxde | grep -v openbox)

Nice, never knew about $( ) . That I'll remember.

Thanks. smile

Offline

#8 2012-06-04 22:36:51

karol
Archivist
Registered: 2009-05-06
Posts: 25,440

Re: A simple way to remove a group except a specified package?

tomk wrote:

I know you're sorted now, but you could have done this:

pacman -R $(pacman -Qgq lxde | grep -v openbox)

Wouldn't this leave a bunch of orphans?
'pacman -Rs' seems a better way to do it.


@m73
Please remember to mark the thread as solved.

Offline

Board footer

Powered by FluxBB