How to install an application via ssh in a version controlled way

For example, I will try to remove Mail version 3.2.0 and install Mail version 3.1.1.

I found a removal solution:
sudo -u www-data php --define apc.enable_cli=1 /var/www/nextcloud/occ app:remove mail

and found a solution for the installation of the current version (as of today, version 3.2.0):
sudo -u www-data php --define apc.enable_cli=1 /var/www/nextcloud/occ app:install mail

But how can I install the previous version e.g. mail 3.1.1?
I tried this:
sudo -u www-data php --define apc.enable_cli=1 /var/www/nextcloud/occ app:install mail -version 3.1.1

But it does not work. Can anyone help me? Is there a way to do this?
Thank you very much.
Holgus

the following was works for me:
sudo -u www-data php --define apc.enable_cli=1 /var/www/nextcloud/occ app:remove mail
cd /tmp && wget https://github.com/nextcloud-releases/mail/releases/download/v3.1.1/mail-v3.1.1.tar.gz
tar -xvzf mail-v3.1.1.tar.gz
mv mail /var/www/nextcloud/apps
sudo -u www-data php --define apc.enable_cli=1 /var/www/nextcloud/occ app:install mail

after that I can go in the GUI of NextCloud an can enable 3.1.1 Mail

1 Like