2

I want pacman to check for updates on system startup without asking me for password. I created a script ~/bin/startup which is executed through ~/.config/i3/config.

In ~/.config/i3/config:
exec_always --no-startup-id $HOME/bin/startup
In ~/bin/startup I have this line:
termite -e 'sudo pacman -Syu ; sudo pacman -Fy'.
And in /etc/sudoers I added at the end of the file:
dovaogedot ALL=NOPASSWD: /usr/bin/pacman -Syu, /usr/bin/pacman -Fy

If I launch the script from terminal:
$ ~/bin/startup
it doesn't ask for password and performs check for updates. But when I restart i3 or reboot my PC it does ask for password and after I type it it just closes termite's window without executing pacman's commands.

But if I use only one pacman command in my script (i.e. without -Fy) it works as intended. Can somebody explain to me this behavior?

  • Use a system startup script rather than a user login script. It's then going to run as root and none of this sudo stuff is necessary. – roaima Mar 30 at 13:22
  • I guess it's a syntax issue. What about dovaogedot ALL=(ALL) NOPASSWD: ALL? – bilabila Apr 22 at 13:24

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Browse other questions tagged or ask your own question.