Recently I rebuilt a server using Digital Ocean. WordPress was installed and everything was working except trying to update or add plugin/ theme. This ‘error’ came up.
There are X method to overcome this.

1. Insert FTP Credentials.
Like duh, just insert your FTP credentials it will work just. Slightly different story if you are using port 22. The hostname should be ftp.your-domain.com:22. Only use FTPS (SSL) if you have one. Or you can add this line on your wp-config.php on your wordpress root folder. [crayon]/* FTP Credentials in wp-config */ define(“FTP_HOST”, “domain-name”); define(“FTP_USER”, “user”); define(“FTP_PASS”, “password”);[/crayon] Note: Be sure to change the credentials above. But not many like this method because you are leaving your credentials on the server.2. Insert FS_METHOD
Open your wp-config.php on the root folder of wordpress. Add this line in the file. [crayon] /*FS Method added to bipass FTP*/ define(‘FS_METHOD’,’direct’); [/crayon] If you are getting this error while trying to updateThe update cannot be installed because we will be unable to copy some files. This is usually due to inconsistent file permissions.: wp-admin/includes/update-core.php Installation FailedIt could be mean your file permission is wrong and as well as the ownership. Which brings us to the 3rd method.