Patch existing snap without rebuilding


I want to patch a bug in installed snap, but all files are read-only even under root. Is there any common way to do that? Download, unpack and install in try mode should be fine, but I don’t see a way to unpack it.


i typically do:

(make sure the snap isnt running while doing this)

mkdir ~/tmp
cd ~/tmp
cp /snap/foobar/current/bin/ .
... do your edits ...
sudo mount --bind /snap/foobar/current/bin/

(dont forget to unmount again later …)