Installing a theme on localhost, Ubuntu 16.04

The directory /wp-content/ of your local installations needs permission to create directory. It is necessary to upload the package and unpack.

rights

Maybe this should helps, if the user is www-data.

chown -R :www-data /var/www/html/wordpress/wp-content/uploads

chown -R :www-data /var/www/html/wordpress/wp-content/upgrades

Or full access to the wp-content directory sudo chmod -R 777 wp-content/

php.ini

Also maybe the php.ini have not the right values to upload the package. Maybe you should try it with a small package. Or you change the php.ini of the LAMP, like the follow entries.

max_execution_time = 180
max_input_time = 600
post_max_size = 128M
upload_max_filesize = 256M

helpful link

At least, a link to a helpful thread.