You are not logged in.

#1 2010-01-10 15:53:36

willxtreme
Member
Registered: 2010-01-07
Posts: 150
Website

[SOVLED] How to pacman -Syu as a normal user?

Hello,

I'd like to run pacman -Syu as a normal user with a single command instead of having to change to root and then run the command smile

Last edited by willxtreme (2010-01-10 16:19:10)

Offline

#2 2010-01-10 15:55:51

kalpik
Member
From: India
Registered: 2007-05-08
Posts: 163
Website

Re: [SOVLED] How to pacman -Syu as a normal user?

Use sudo?

Offline

#3 2010-01-10 15:58:27

Coacher
Guest

Re: [SOVLED] How to pacman -Syu as a normal user?

And bash's alias.

Last edited by Coacher (2010-01-10 15:58:55)

#4 2010-01-10 15:58:37

willxtreme
Member
Registered: 2010-01-07
Posts: 150
Website

Re: [SOVLED] How to pacman -Syu as a normal user?

[root@sasoria will]# mousepad /etc/sudoers
And at the bottom I add
will sasoria=NOPASSWD: ...
and I don't know the rest yet

Offline

#5 2010-01-10 15:59:26

bharani
Member
From: Karaikudi, India
Registered: 2009-07-12
Posts: 202

Re: [SOVLED] How to pacman -Syu as a normal user?

alias pacup="sudo pacman -Syu"
Put this in your .bashrc

Also you can edit your sudoers file so as to run this without giving password.

Then you can run updates easily as

 pacup

.


Tamil is my mother tongue.

Offline

#6 2010-01-10 16:02:02

willxtreme
Member
Registered: 2010-01-07
Posts: 150
Website

Re: [SOVLED] How to pacman -Syu as a normal user?

Allright so in 2 steps
1)
[root@sasoria will]# mousepad /etc/sudoers
And at the bottom I add
will sasoria=NOPASSWD: /bin/bash ?
and
2) alias pacup="sudo pacman -Syu"added in .bashrc

Offline

#7 2010-01-10 16:10:47

Blue Peppers
Member
From: Newbury, UK
Registered: 2009-02-01
Posts: 178

Re: [SOVLED] How to pacman -Syu as a normal user?

sasoria=NOPASSWD: /bin/bash will run allow you to run your whole shell as root, wich has no advantage as far as I can see.

You can do

sasoria=NOPASSWD: /bin/pacman

That will let you execute pacman, with any option, as root, with out the pasword. I don't personaly know if the sudoers file lets you specify certain options for programs that can be executed without the pasword, but I think not. Feel free to correct me though smile


Consistency is not a virtue.

Offline

#8 2010-01-10 16:13:50

ssjlegendx
Member
Registered: 2008-01-01
Posts: 94
Website

Re: [SOVLED] How to pacman -Syu as a normal user?

I would suggest that you install and configure sudo for use by your user (see the wiki) and then add something like the following to your shell config (~/.bashrc, ~/.zshrc, or the like):

alias pacup='sudo pacman -Syu'

You can add the follwing to /etc/sudoers if you want to do this without entering a password (assuming pacman is installed in the standard location):

will sasoria=NOPASSWD:/usr/bin/pacman

NOTE: You should never edit /etc/sudoers without using visudo (try EDITOR=mousepad visudo); it will ensure that you don't screw up the sudoers file with incorrect syntax.


#!/vim/rocks

Offline

#9 2010-01-10 16:18:52

willxtreme
Member
Registered: 2010-01-07
Posts: 150
Website

Re: [SOVLED] How to pacman -Syu as a normal user?

Thank you very much for your fast replies the problem is now Solved! big_smile

Offline

Board footer

Powered by FluxBB