Join GitHub today
GitHub is home to over 28 million developers working together to host and review code, manage projects, and build software together.Sign up
Issue with the snap installed version #3143
Trying to use
When I provide the full path, I get
@bep, thank you for the /cc!
What you are seeing, as inconvenient it may be, is Snaps' default and expected behaviour for security reasons. To quote https://snapcraft.io/:
Snaps are read-only and have segregated data stores
Snaps are read-only for security. We want to prevent a hostile party from sneakily changing the software on your machine, so you cannot modify a snap that is installed on your system. This also means you can always check the signature on the snap, even long after you installed it, to make sure it is still exactly the software you intended. If you want to modify a snap, you can usually build your own version of it, especially if it is open source.
So where can a snap write data? Each snap gets its own set of writable directories which have specific properties. There are two directories which the snap can write to independent of the user. One of these is versioned - each time the snap is upgraded the data is saved and the new snap revision can upgrade its copy. The other ‘common’ data directory is not versioned and is used for big blobs of data that you don’t want to duplicate across revisions of the snap:
Typically, configuration is stored in one of these, along with system-wide data for the snap.
There are also an equivalent two writable directories for each snap in the user home, which can be used to store snap data that is specific to one user or another, separately:
This way applications can be immutable for security reasons while still offering a full and rich user experience. To learn more about the makeup of a snap please see the snap architecture article.
So, for most snaps, non-root users may only write inside two specific directories, and for Hugo, I would have had to limited myself to
Thankfully, in the snapcraft.yaml "recipe" kindly provided by our friends like @dholbach from Canonical, this restriction was relaxed with the use of the
What it means is that you can use the snap edition of Hugo to write (i.e. run
Should we relax this restriction even further? I suppose we could (I don't know how yet), but since that would go against Snaps' security model and design philosophy, so I have my reservations too.
So, perhaps the "write inside $HOME only" needs to be documented, perhaps in docs/content/overview/installing.md right after the
Thank you for the detailed response, @anthonyfok.
I ended building
Documenting this limitation in the documentation would be definite improvement.
@anthonyfok I'd like your input on whether this is something that should be added to upcoming documentation for Linux installation (not in its entirety, but maybe as a callout/admonition => just 1 or 2 sentences).
In other words, is this a common "gotcha" for Linux users?
Thank you for asking! Yes, this is something that needed to be added to the Hugo documentation, maybe for both installation instruction and for the
As in whether it is a common "gotcha"? Yes, it is for all Linux users who decided to install Hugo as a "snap", but such restriction does not exist for .deb, .rpm or .tar.gz packages/archives.
My personal favourite is actually
That said, while Snaps are universal and do work on Fedora and other non-Debian/non-Ubuntu Linux distributions, I would wildly guess that 90% of Hugo Snap users are Ubuntu users. Mind you, Ubuntu is the most popular Linux distribution, so I foresee more and more users running into this "write in
(The Fedora/Red Hat/GNOME world has their own Flatpak which is somewhat similar to Snaps, though I haven't used Flatpak and thus cannot comment on its similar "write in
Thank you for updating the documentation! It looks really nice, though the so-called "
I just discovered something new though: It turns out there is a new
So, it is possible, but users would then have to type
Anyhow, back to the actual documentation text. :-)
I recommend making the following revisions:
Also, I notice the absence of installing Hugo as a traditional
Yes, I recommend placing the secions on Arch and Debian/Ubuntu together, and placing the Snap section right underneath. ;-)
By the way, English is not my first language, so please feel free to revise whatever I have written.
Many thanks @rdwatters!
referenced this issue
Mar 13, 2017
A. I never would have guessed. Your English is fantastic!
Thank you @aquilax as well. Cheers.
Thank you @rdwatters!
Wow, that was quick! Thank you for fixing the docs so quickly!
Actually, what I meant to say is to place the Arch section and Debian/Ubuntu section one after the other. My bad for a poor choice of word "together". I am also hoping someone will step up with the RPM maintenance for the Fedora / Red Hat / openSUSE ecosystems too so we can add that in the near future. (Looks like someone has! https://discuss.gohugo.io/t/solved-fedora-copr-repository-out-of-service/2491/12)
That said, if you personally prefer keeping these distros all under one section, that is fine with me too. :-)
One more nitpicking:
Please add a missing space between "