Is there a "--noconfirm" for password?

I usually do my updates right before I go to sleep. I tend to fall asleep always when I update that it makes it invalid because of input time outs. Is there a command that's similar to --noconfirm but for passwords?

sounds like a recipe for disaster to me. I don't believe there's a no confirm option but in theory you could switch to root account before running the update so that you don't have to input the sudo.

the better practice would be to do the update the next day and pay attention to what is going on. also, confirmation is a safety net that shouldn't be circumvented. there may also be conflicting packages that need dealing with or other important messages in the output you need to deal with after updating regardless of it timing out. If you aren't present then you won't see them and that could lead to a non-bootable system in the worst case scenario.

1 Like

What you can do is create a file /etc/sudoers.d/upgrade or whatever you want to call it. Put in:

%wheel ALL = (root) NOPASSWD: pacman *

This will make sudo not ask for a password anytime you do sudo pacman [blah blah blah] if you want to restrict it just for upgrades they would could do:

%wheel ALL = (root) NOPASSWD: pacman -Syyu

That way if you do sudo pacman -S foo it will still ask for a password, but when you do sudo pacman -Syyu it won't.

One note when creating this file, if you screw it up, sudo breaks. So what I usually do is run sudo bash use that terminal to edit the file (nano /etc/sudoers.d/upgrade). Then to test I start another terminal and test the sudo command. If sudo fails, then I can fix the file.

If you do sudo nano /etc/sudoers.d/upgrade save and exit and break sudo with a bad file, when you try to fix it with sudo nano /etc/sudoers.d/upgrade that won't work either. Make sense? If you do break sudo and don't have a root shell open, you will have to login as root to fix it. (Ctrl-Alt-F2 and login to the text console as root.)

1 Like

You don't say what you are using to do update. The fact that your are getting password timeouts would lead to believe you are using pamac or an AUR wrapper of some sort.

In these case, you should never use sudo or run them as root.

If you use yay, you can use the option --sudoloop or set it in the config file. That way, it will only ask you for your password once at the beginning. You could also use the option --combined-upgrade which forces all the prompts to the beginning of the process.

This topic was automatically closed 90 days after the last reply. New replies are no longer allowed.

Forum kindly sponsored by