Why can snap files not be modified in any way?
While the premise of the question is technically correct (you can't change files of a snap), there are ways to work around this.
One such way is to use the --bind
option in conjunction with mount
, to remount the existing file hierarchy to somewhere else.
For example, if you want your snaps to use the system certificates instead of the certificates installed in core
, you can mount the directory containing the system certificates on the host on top of the system certificates directory in core
with the following command:
sudo mount --bind -o nodev,ro /etc/ssl/certs /snap/core/current/etc/ssl/certs/
This doesn't actually change the snap filesystem. If you unmount the folder, the old folder will take its place:
sudo umount /snap/core/current/etc/ssl/certs
Note: Mounts do not persist between reboots. There are several ways to make mounts persist after a reboot. One such way is to create a systemd
startup script:
$ cat <<-EOF | sudo tee /etc/systemd/system/snap-core-current-etc-ssl-certs.mount
[Unit]
Description=Mount unit to fix etc ssl certs in core package
After=snapd.service
[Mount]
What=/etc/ssl/certs
Where=/snap/core/current/etc/ssl/certs
Type=none
Options=bind,nodev,ro
[Install]
WantedBy=multi-user.target
EOF
$ systemctl enable snap-core-current-etc-ssl-certs.mount
Taken from here.
It's impossible to change the contents of the snap without re-building the snap. This is primarily a security measure, to ensure that the snap hasn't been tampered with.
However, the icon referred to is likely in a desktop file called blender-tpaw_blender.desktop
which is editable, and can be found in /var/lib/snapd/desktop/applications
.
You could change the following line to update the icon:-
Icon=/snap/blender-tpaw/3/meta/gui/icon.svg