First you need to add the following code in your wp-config.php file.
But this is old idea. If you dont want to add the ftp access in wp-config.php file then Just add the following line wp-config.php file.
Note: You need to give 755 permission to wp-content folder. Create the upgrade folder in wp-content folder.
If still you are facing issue then give 777 permission to all wp-content folder.
For permission use following command
sudo chown -R www-data wp-content
sudo chmod -R 755 wp-content
WordPress will try to write a temporary file to your /wp-content directory. If this succeeds, it compares the ownership of the file with it’s own uid, and if there is a match it will allow you to use the ‘direct’ method of installing plugins, themes, or updates.