You are not logged in.
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 ![]()
Last edited by willxtreme (2010-01-10 16:19:10)
Offline
Use sudo?
Offline
And bash's alias.
Last edited by Coacher (2010-01-10 15:58:55)
[root@sasoria will]# mousepad /etc/sudoers
And at the bottom I add
will sasoria=NOPASSWD: ...
and I don't know the rest yet
Offline
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
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
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/pacmanThat 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 ![]()
Consistency is not a virtue.
Offline
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/pacmanNOTE: 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
Thank you very much for your fast replies the problem is now Solved! ![]()
Offline