The other day I was trying to install massCode application. For installation, it provided a Snap file to download.
When I tried to install the application from Snap file
sudo snap install snap_file
It gave me the following error:
error: cannot find signatures with metadata for snap “masscode_2.6.1_amd64.snap”
That was strange. While adding external repositories in Ubuntu, you have to add the GPG key. But no such things were provided by the developer here.
The ‘fix’ is easy and simple. Let me explain it to you.
Handling “cannot find signatures with metadata for snap” error
There are no signatures involved here.
What happens is that you have downloaded a Snap installer file from a third party. The snap mechanism in Ubuntu expects you to get the snap packages from the official snap store.
Since it doesn’t come from the snap store, you see the ‘cannot find signatures with metadata for snap’ error message. The error message is not descriptive, like most error messages.
So, what’s the solution here?
Any snap package that is not distributed through the Snap store has to be installed with the –dangerous flag. That’s the rule.
sudo snap install --dangerous path_to_snap_file
This way, you tell the snap package manager to explicitly install the snap package.
Here, I used this flag and was able to install massCode from its snap package successfully.
How ‘dangerous’ is it to install snap packages this way? Almost the same as downloading and installing packages in deb format.
In my opinion, if you are downloading the snap package from the project developer’s website, you are already entrusting the project. In such cases, you can install it with the –dangerous flag.
Of course, you should first search if the package is available in the snap store or not:
snap find package_name
I hope this quick little tip helped you fix the Snap error. If you have questions or suggestions please let me know. If you want to learn more, see this guide on using Snap commands.