Sorry for my bad English, but I'm really trying to be better. Ok. I've created a new command/alias(changejava) on Ubuntu 12.04, and I need to skip "sudo password" only when I write "$changejava". If I write "$changejava" using terminal, Ubuntu show me what can I do. I just need to press 0, 1 or 2. But if I press anything, terminal says:
"update-alternatives: to use /usr/lib/jvm/java-6-sun/jre/bin/java to provide /usr/bin/java (java).
update-alternatives: error: Could not create file '/var/lib/dpkg/alternatives/java.dpkg-tmp': Denied. "
If I try "$sudo changejava", I have: "Type jessegaspar password", and the magic happens. Without "sudo", does not happen. I tried to edit /etc/sudoers with:
%sudo ALL=NOPASSWD: ALL
...However all users will have access to the total permission "sudo". :/ :/