Insert this line at the end of your wp-config.php file. This file is found in your site’s public root directory, sometimes called www, httpdocs or public_html.
define('FS_METHOD','direct');
This will allow your site to bypass all the permission and file ownership warnings and update your WordPress installation to the latest version.