If you are unable to update WordPress or your WordPress plugins and receive an error about insufficient permissions, for example:
Update Failed: The update cannot be installed because we will be unable to copy some files. This is usually due to inconsistent file permissions.
It may be because WordPress isn’t allowed to access its own directory. To give it permission to access its own directory, change the owner of the Apache ‘/var/www’ directory to the user ‘www-data’. That user is the one that web server software operates under in order to protect the rest of your system from attackers.
To resolve the issue, run the following command at your server’s command prompt:
sudo chown -R www-data:www-data /var/www