One of the (many) things I like about WordPress is its ability to be able to automatically upgrade both the core installation and the plugins. This can also be one of the most frustrating part of WordPress too.
Those that have attempted to update their plugins using the automatic option may well be familiar with the following:
Unpacking the update
Deactivating the plugin
Removing the old version of the plugin
Could not remove the old plugin
Plugin upgrade Failed
Searching the forums reveals lots of frustrated users and very little in the way of solutions. I was one of these frustrated users but I have cracked the issue and this post outlines what I did to get it to work for me.
The first thing to keep in mind is that you can only use FTP or FTPs to do the updates and not sFTP (SSH) which is what I would normally use to make updates. Therefore I had to install an FTP server (vsftpd for my Ubuntu installation) and create a new user. This had a direct impact on the issue as you will see as it meant that the installed files were owned by a different user to the user doing the upgrade. Also the upgrade process needs a folder called wp-content/upgrade folder that doesn’t exist by default, so that needed to be created.
The key to all this is to ensure that the user that is doing the upgrade has access to both the wp-content/plugins and wp-content/upgrade folder. I would recommend adding the upgrade user to the same group as the users that originally created the installation. You will then also need to give the plugins and upgrade folders write permissions for the group.
The alternative is to make sure that you use exactly the same user to do the upgrades as the original installation and make sure that both plugins and upgrade folders has write permissions for this user.
Anyway, getting the users and permissions straightened made the difference for me, your milage may vary, as they say.