I am trying to add support for a proprietary codec in Opera according to this question. However, my version of Opera is installed as a snap. I thus would need to know how to create a directory and copy a file into the snap
folder in Ubuntu 20.04.
More specifically, the issue is that the Opera browser is installed in the snap
folder and if I try to create a directory in that folder, I get the error mkdir: cannot create directory ‘lib_extra’: Read-only file system
. The complete path of Opera is snap/opera/85/usr/lib/x86_64-linux-gnu/opera
. I also tried to use chmod
and mount
-remount
but I got similar errors.
There is a snap application called 'overlay' - you can install it via Snap Store. This little app makes it possible to remount a snap read/write. Then you can create a directory and copy files there. However, it needs to be repeated evry time the system starts up, so you have to write a script that is called on system startup, which remounts the Opera snap r/w using 'overlay', and then creates the appropriate directory and copies files. (Actually you don't have to use the 'overlay' application, you can remount a snap r/w using just 'mount' command with overlayfs, but that application simplifies it).