Ubuntu – Consequences of using apt-get in ubuntu touch

aptubuntu-touch

I have just received my BQ Aquaris E4.5 Ubuntu edition.
I have been playing around with it and find that it is just what I expected it to be.

One of the great things about it is a full ubuntu stack, including package management. I would like to start using apt-get to install stuff such as htop, python2, openvpn, among others.

However, I have reached the apt-get Unable to write to /var/cache/apt The Package lists or status file could not be parsed or opened error.
I understand (Ubuntu Touch using apt-get) that this is due to the "/" partition being mounted as ro, and apt-get needs it to be rw in order to work.

Here (Install with sudo app-get install doesn't work, "Not using locking for read only file /var/lib/dpkg/lock") is how you can work around the problem, with the following command sudo mount -o remount,rw /. <— May be a bad idea. See evergreen's answer for a more complete and safe way to enable rw mode.

What I would like to know is what are the consequences of mounting "/" as rw.
I have read that it will for starters stop the OTA updates, with which I'm perfectly OK as long as I can keep my system up-to-date using apt-get.
However, I ave also read (https://askubuntu.com/a/583439/264601) other kinds of horror stories.

So my 2 questions are:

  1. Will I be able to keep my system up-to-date using just apt-get?
  2. Other than disabling OTA updates, what other consequences should I expect?

Thank you very much for your answers!

Best Answer

  1. No (but it will feel like yes for a while)

If you enable rw on / and start modifying it, nothing disables the delivery of OTA updates. So when they arrive, they will be offered to you for install, as before.

However, the OTA process does a very simple thing to the filesystem. It just untars a large set of files on top of the filesystem you have. Since it knows (because it should be ro) the previous filesystem, this is simply a set of the files that have changed.

So you are gambling. Do the changes you have made cause side effects when this happens? In general, yes. In general, you will have modified some file in the / filesystem, and added software that depends on that change. When an OTA is installed, that change will be removed, and potentially replaced with a conflicting change. At this point, what happens next is unknowable, and certainly untested.

So, in practice, some apt-get installs will largely add software in parallel to the existing files, so will not be much impacted by an OTA. However, one file set will certainly be impacted - apt's own record keeping (OTA's deliver the records used in construction of the ro filesystem). So your system will lose the knowledge of what is there, and what is not.

This is the core danger with apt-get upgrade. It will always be performed with an incorrect database of what is on the device, so it cannot be guaranteed to succeed. As your additions become more complex, and as the underlying system makes major transitions (such as when the phones moved from Utopic to Vivid), apt-get run by hand will do the wrong thing.

Every OTA then becomes a gamble, until you perform a wipe & reinstall.

  1. Your system will become slowly broken - see above.
Related Question