Make /usr/local writable on core

Bug #1967119 reported by Hadmut Danisch
6
This bug affects 1 person
Affects Status Importance Assigned to Milestone
Snappy
Opinion
Wishlist
Unassigned

Bug Description

Hi,

I'm currently doing some experiments with a raspberry pi 4 and Ubuntu core core20 20220318

Ubuntu core comes with python, but not pip to install modules, and since ansible installation sometimes requires to have some python modules installed, I was figuring out how to teach a core system use python modules. Since core doesn't come with the ensure-pip module, the method of choice is to download https://bootstrap.pypa.io/get-pip.py and run it.

The problem:

Although the script works and installs a running pip command, it doesn't find a place (other than it's help page, it takes the --prefix=/usr/local argument) to install it to a place, where both root and users can access it. It ends with installing it to /root/.local/bin, which is accessible to root only.

Strangely, core comes with empty dirs

/usr/local/
/usr/local/share
/usr/local/share/fonts

but write protected, so there is nothing in, and not possible, to install anything in. Unclear, what they are good for and why core comes with.

Actually, it is easy to create a /writable/python and install it into it, but that's really ugly.

So my proposal is to make /usr/local a writable directory, i.e. bind-mount some subdir of /writable (as with other paths) to /usr/local

That would also allow to install other important programs that are not available as snaps, e.g. git, in a common and usual place where every user can access it and will find it by default.

Revision history for this message
Hadmut Danisch (hadmut) wrote :

Interestingly, /etc/fstab and /etc/system-image/writable-paths refer to

# See writable-paths(5) for full details.

but core does not come with man-pages. Instead, it asks to visit https://manpages.ubuntu.com/ , which does not offer man pages for ubuntu core.

summary: - Make /usr/local writable
+ Make /usr/local writable on core
Revision history for this message
Paweł Stołowski (stolowski) wrote :

These paths exist only because UC20 image is based on a "snapshot" of Ubuntu filesystem.

Ubuntu Core is designed for IoT and with strict confinement in mind where all apps and their dependencies are distributed as snaps, therefore it is not expected to have a writable location such as /usr/local for software installed "aside" as in regular distros (instead, your app along all the python modules it needs should be a self-contained snap). This is by design. If you need full flexibility then maybe a better choice would be Ubuntu Server for pi 4?

Changed in snappy:
status: New → Opinion
importance: Undecided → Wishlist
Revision history for this message
Hadmut Danisch (hadmut) wrote :

I disagree.

First of all, there is a lack of documentation. I have not found any description about how to actually use Core and not to use core.

Second: To the best of my knowledge, there is no way to use my own snap server. I either to have to use the snapcraft store or copy a snap file onto the core device and load locally.

Third: You do run into the chicken-and-egg problem. If everything needs to be installed as a snap, where does the software to select and install the snaps come from then? If you cannot use tools like ansible to configure the machines because of the lack to properly install python modules, this, at the end of the day, means, that there is no procedure to automatically install and configure the core machine.

If you

- do expect people to use solely snaps as the only software installation method
- do not allow to use my own snap server
- do not even provide basic tools like git to manage configuration scripts e.g. for LXD or docker
- do not provide documentation about what is the intended way to use core and what to not do

then core is actually locked and a dead project.

I had intended to use it as a base for a reliable server machine because of it's ability to automatically update itself, but under these conditions it is rather useless.

And the alternative is not Ubuntu Server, but Fedora CoreOS then.

To post a comment you must log in.
This report contains Public information  
Everyone can see this information.

Other bug subscribers

Remote bug watches

Bug watches keep track of this bug in other bug trackers.