Error when upgrading Wordpress from 3.4.2 to 4.0

Just a couple minutes ago I's trying to upgrade our "ancient" wordpress blog which is still running on a Ubuntu 10.04 server from version 3.4.2 to the latest version, 4.0. It wasn't that easy. This error showed up after I press the "Upgrade" button:

The package could not be installed.: PCLZIP_ERR_BAD_FORMAT (-10)...

What's up man?

Okey, I did these following to fix that:

1. Make sure the wordpress directory has the correct owner:

$ sudo chown -R www-data:www-data /var/www/wordpress

2. Then temporary change permission of the wordpress folder like following:

$ sudo chmod 0755 -R /var/www/wordpress
$ sudo chmod g+s -R /var/www/wordpress

Then I ran the upgrade again. It worked like a charm!!! \m/\m/\m/

Note: remember to change the permissions back after you finish the upgrade (or you can use a security plugin to do it for you)