You are not logged in.

#1 2008-06-17 16:21:29

Benzo
Member
From: Lima, Peru
Registered: 2008-05-25
Posts: 46

Pacman -Rs instead pacman -R by default

What if pacman uses pacman -Rs by default instead of pacman -R?

When you install a program you want, you install all the necessary dependencies to make the program you want works with just a:
# pacman -S "program"

When you uninstall it you should also get rid of those dependencies without noticing because you never wanted to have them but just the program you wanted to install works, something like:
# pacman -R "program" (and it should work like the actual pacman -Rs "program")

I think is much more common to erase a program with all its dependencies than erase just the program and leave its dependencies installed in you computer, so to erase a program leaving its dependencies should be done by an extra option of R, like:
# pacman -Rk "program" (from keep dependencies) for example and it will do the actual pacman -R "program"

Also its more symetrical:
# pacman -S "program" installs everything to have "program" working
# pacman -R "program" erases everything that was installed to have "program" working

An extra idea is that newbies would ask less how to keep their system clean. wink

What do you think people?

Offline

#2 2008-06-17 16:37:35

Sp4rkR4t
Member
From: Southampton
Registered: 2008-05-06
Posts: 110

Re: Pacman -Rs instead pacman -R by default

I can see the logic behind this, not a bad idea.

Offline

#3 2008-06-17 17:03:21

Benzo
Member
From: Lima, Peru
Registered: 2008-05-25
Posts: 46

Re: Pacman -Rs instead pacman -R by default

Thanks

Offline

#4 2008-06-17 17:26:27

JeremyTheWicked
Member
From: Poland
Registered: 2008-05-23
Posts: 193

Re: Pacman -Rs instead pacman -R by default

I sincerely don't like this idea. E.g., I use several packages which were installed as dependencies - I don't want pacman to try and remove them by default every time I remove something that needs them. The current solution is a lot more K.I.S.S. (i.e., the action taken with the least options is the most basic one - this is intuitive to me). Moreover: I am always against changing something that works well.

And you can make aliases to emulate this behavior if you wish.


arch(3) adj amused because you think you understand something better than other people ;P

Offline

#5 2008-06-17 17:41:26

Benzo
Member
From: Lima, Peru
Registered: 2008-05-25
Posts: 46

Re: Pacman -Rs instead pacman -R by default

I sincerely don't like this idea. E.g., I use several packages which were installed as dependencies - I don't want pacman to try and remove them by default every time I remove something that needs them.

Ok, but you could always keep them with another option, like pacman -Rk "program" as I gave as example. I understand that you might need them but which action is more commonly used, even for you: uninstall just the program and keep dependencies because you are going to need them or uninstall the program and dependencies?

The current solution is a lot more K.I.S.S. (i.e., the action taken with the least options is the most basic one - this is intuitive to me).

Ok, intuitive for me is to keep my system as it was before I install anything with the least options.
Not intuitive, for me, is to do pacman -Rs anytime I unistall something, why? because I did just a pacman -S to install it

Moreover: I am always against changing something that works well.

Yes, it works well but you can always do things even better, easier, faster, whatever.

And you can make aliases to emulate this behavior if you wish.

No I can't, I don't know how to code yet. And I think this idea is good enough not only for me but could be helpful to the arch community.

Greetings

Offline

#6 2008-06-17 18:26:44

JeremyTheWicked
Member
From: Poland
Registered: 2008-05-23
Posts: 193

Re: Pacman -Rs instead pacman -R by default

With regards to aliases, you can write e.g.:

alias pacr='pacman -Rs'

Add this to your .bashrc and you can then "pacr package" and it will remove the dependencies as well.

Actually, I have some aliases of this kind in my .bashrc. Feel free to steal them wink

alias yi='yaourt -S'
alias ys='yaourt -Ss'
alias yu='yaourt -Syu'
alias yr='sudo pacman -Rcsn'
alias pac='sudo pacman-color'

Edit: It's easier than re-coding pacman, isn't it wink

Last edited by JeremyTheWicked (2008-06-17 18:28:08)


arch(3) adj amused because you think you understand something better than other people ;P

Offline

#7 2008-06-17 18:40:43

Sjoden
Member
From: WA
Registered: 2007-08-16
Posts: 380
Website

Re: Pacman -Rs instead pacman -R by default

I like the idea of aliases(I've never used them), and I don't think Pacman needs to be changed.
    That said, I totally agree with Benzo. I don't see a need to keep dependencies on my system that I 'might' need in the future, seems useless to me. They are still in your cache unless you clear it, and anytime you need it as a dependency it will just get pulled with whatever program needs it. Also, (R)emove, and (R)emove plus (k)eep depends seems very logical/intuitive.
    I just don't see it as that important to consider changing it though, no matter how easy it would be. Unless of course, a dev wanted to do that. Or I'm sure someone could write a patch to pacman which would do just that. Might even get accepted if it the devs thought thats what the community wanted/needed. Also, the patch could always be put in the AUR, and maybe make it to an official repo.

2 cents,
Zack

Offline

#8 2008-06-17 18:44:45

Benzo
Member
From: Lima, Peru
Registered: 2008-05-25
Posts: 46

Re: Pacman -Rs instead pacman -R by default

Ok, thanks for this JeremyTheWicked, I didn't know that and I will steal your .bashrc for a while. Anyway I think my suggestion should be considered or at least to have a bigger debate.

Offline

#9 2008-06-17 19:02:06

ghostHack
Member
From: Bristol UK
Registered: 2008-02-29
Posts: 261

Re: Pacman -Rs instead pacman -R by default

Benzo, how would you deal with the following situation:

pacman -S vlc  (pulls in e.g. lame as dependancy)
pacman -S mplayer (also needs lame as dependancy, but it is already installed)
pacman -R vlc

if -Rs was the default pacman would want to remove lame since it was only installed as a dependancy of vlc, not of mplayer.

Offline

#10 2008-06-17 19:12:15

mcmillan
Member
Registered: 2006-04-06
Posts: 665

Re: Pacman -Rs instead pacman -R by default

Personally I agree that default removing dependencies seems to make more sense, though I imagine something as central as pacman people are reluctant to change. But if you want the devs to pay attention posting on the forums isn't the best way. Go post a feature request on the bug tracker

Offline

#11 2008-06-17 19:35:22

schivmeister
Developer/TU
From: Singapore
Registered: 2007-05-17
Posts: 960
Website

Re: Pacman -Rs instead pacman -R by default

This is worth a thought for the devs, possibly. As I see it, modern package managers like pacman are as intelligent as their coders.

No,

pacman -S vlc  (pulls in e.g. lame as dependancy)
pacman -S mplayer (also needs lame as dependancy, but it is already installed)
pacman -Rs vlc or -Rscn

will NOT (prompt to) remove lame. And anything that is an optional dependency which was installed explicitly will NOT be taken into the equation. As such, what's left are orphaned packages, which means you are NOT using them in anyway because (1) none of the installed programs source/execute them and (2) you don't know of their existence.


I need real, proper pen and paper for this.

Offline

#12 2008-06-17 19:47:04

Benzo
Member
From: Lima, Peru
Registered: 2008-05-25
Posts: 46

Re: Pacman -Rs instead pacman -R by default

mcmillan wrote:

if you want the devs to pay attention posting on the forums isn't the best way. Go post a feature request on the bug tracker

True, but I wanted to share my idea to know how good or bad it was. So I'll post it in the bug tracker.

Offline

#13 2008-06-18 02:14:19

Benzo
Member
From: Lima, Peru
Registered: 2008-05-25
Posts: 46

Re: Pacman -Rs instead pacman -R by default

http://bugs.archlinux.org/task/10683 this is the feature request

Offline

#14 2008-06-18 19:31:16

schivmeister
Developer/TU
From: Singapore
Registered: 2007-05-17
Posts: 960
Website

Re: Pacman -Rs instead pacman -R by default

Dan and Xavier have spoken, and I now realise that it's not really something to think too much about lol And

Ok, thanks for this JeremyTheWicked, I didn't know that and I will steal your .bashrc for a while.

explains it. Users just need this tiny bit of knowledge, and not a code change of /usr/bin/pacman. An alias is 49 lines shorter than 50 lines of diffs.


I need real, proper pen and paper for this.

Offline

Board footer

Powered by FluxBB