Cannot install Enclave on Ubuntu, enclave.service is masked

New user asks: When installing Enclave using sudo apt-get install enclave the installation fails with the message

Failed to enable unit: Unit file /etc/systemd/system/enclave.service is masked.
Failed to restart enclave.service: Unit enclave.service is masked.

When Enclave is uninstalled using apt-get remove enclave systemd sets the enclave service as masked. Masked services cannot be started manually nor by the system at boot time.

The next time Enclave is installed on the same system, apt is unable to start the Enclave service and the installation fails.

To fix this, first check that the service is masked

$ sudo systemctl status enclave
 enclave.service
     Loaded: masked (Reason: Unit enclave.service is masked.)
     Active: inactive (dead)

If the service is masked, we can use systemctl to unmask it

$ sudo systemctl unmask enclave
Removed /etc/systemd/system/enclave.service.

Now the service is unmasked try the installation again and then manually start the service

$ sudo apt-get install enclave
$ sudo systemctl start enclave

We will fix this in a future release.