When upgrading to OwnCloud 8.2.2, most of this can be done via the web browser. In the Admin page, you will see on the Updates section.
Here is where it will first make your backup. When that is complete, you can click Proceed.
If this fails, run this command to clear out your resources directory.
rm -Ir /var/www/owncloud/resources/*
When you refresh, you will see your frontpage with the option to Upgrade. You can do it from the website or run the following command. The website is graphical but the command line is better for larger installations.
sudo -u www-data /var/www/owncloud/occ upgrade
When completed, you will need to enable your apps from the website or the command line. I like doing the website because then I can see new apps and be given a chance to update the apps to newer versions.