I spent the day upgrading my server to Ubuntu 16.04. I had an OC 8.1 version installed, and apt installed a much later version.
occ upgrade said I skipped versions, which is understandable. It doesn't know about the upgrade requirements.
This is a high level of what I did.
apt-removed php7 and installed php5.6, and made sure apache was also configured for 5.6.
apt-removed owncloud, and apt-installed an owncloud=8.2.11 (upgrading from 8.1.4)
Tried the occ upgrade, and it says:
root@dax:/var/www/owncloud# sudo -u www-data php5.6 /var/www/owncloud/occ maintenance:repair
An unhandled exception has been thrown:
exception 'Doctrine\DBAL\DBALException' with message 'Failed to connect to the database: An exception occured in driver: could not find driver' in /var/www/owncloud/lib/private/db/connection.php:52
Then followed by the stack trace.
My php (cli and apache configs give the same results):
root@dax:/var/www/owncloud# sudo -u www-data php5.6 -m | grep sql