Whats the proper way to update

do i need to log in as frappe or can other user with sudo run the bench update command to update it??
ive been doing the non frappe user method and so far no issue but im afraid it might cause issue in the future

If you update as a different user, the file ownership and permissions might be affected, which will have a negative impact on your system at some point. Best to update as the user you used to create the install.
You also shouldn’t need to use sudo for bench commands, as they are owned by the frappe user and not by root

@trentmu
so i should log in as frappe then do bench update. right?

Yes. You could also login as your normal user, and the do

su frappe
cd ~/frappe-bench
bench update

@trentmu

su frappe

You also shouldn’t need to use sudo for bench commands, as they are owned by the frappe user and not by root

I’m confused earlier you said that theres no need to use the sudo command but later on you grant a su top frappe which if i understand correctly is giving su to a user that does not have su?

also is there a way to revert or fix my mistake when i updated erpnext using a non frappe user?

su allows you to “become” a particular user.
sudo allows you to run commands as if you had root privilege.

If you just run the next update as frappe, it should correct any missed permission items. If it fails at that point, then you might need to fix permissions with a “chown -R frappe:frappe ~/frappe-bench/*” and re-run the update

@trentmu
thanks will try su on next update

Many years ago the command was “switch user” and has long since been shortened to “su”

BKM