I saw a prompt to update my WordPress from version 5.7.z to 5.8.1 on my WordPress admin panel but I have encountered errors during the process. WordPress knowledgebase confirmed that for these versions, an easy upgrade (1 click) can be done without the rigorous process of manually updating the version of an install.

Step 1. Created a snapshot of my instance on my hosting provider. This will serve as a fallback option if my WP update comes with errors that I couldn’t fix. Also, this will serve as the backup of my WP site.

Step 2. On WP, click the notification to update. Here comes the error that I encountered.

Step 3. Further research shows that file permission is indeed the culprit of the error. Particularly the files under “wp-admin/ wp-content/ and wp-includes/ (core files)” the directories under the DocumentRoot of WP. Correct permission settings are needed for the zip download and unpack. WP should also be able to write to these WP core files.

Step 4. SSH into the WP instance and apply permission settings.

Commands

#chown www-data:www-data -R wp-admin/
#chown www-data:www-data -R wp-content/

In my case, only these 2 directories are needed to be reconfigured.

Apply permission settings on Directories and Files. For files permission of 644 or 640 and directories with 755 or 750

#find . -type d -exec chmod 755 {} \;
#find . -type f -exec chmod 644 {} \;

Step 5. Back to WP admin panel. Click update. It should now proceed without errors. After updating WP, you should update other plugins and especially the WP themes if you happen to have one. Check everything if it’s eligible for update and check with your WP theme provider for notes regarding the update if it has a special procedure. Otherwise, it’s just an easy 1 click update.