Consequences of using apt-get in ubuntu touch
To be able to use "apt-get" in ubuntu-touch, for safety I suggest you use the function "Enabling/ Disabling read-write mode".
Once enabled the "read-write mode", this will disable Ubuntu system upgrades.
Howerver you can restore automatic over-the-air updates by disabling the "read-write mode".
"By default the system is read-only. You can switch to read-write mode, although this disables Ubuntu system upgrades.The main purpose for this is developing the Ubuntu system directly. This is not required for developing apps or using the system normally. Recovering from read-write mode is possible but requires reinstalling the system from scratch. Warning: Switching a device to read-write mode (and/or recovering from it) is an advanced feature and may result in complete data loss. Warning: Switching a device to read-write mode disables automatic over-the-air delta updates. Accepting a full over-the-air update after making a device writable may undo changes you have made. "
Firstly, Enabling developer mode on your Ubuntu device. To do this, go to Settings → About this device → Developer mode. (You have to apply the "Lock security" by alternatives: "4-digit passcode" or "Passphrase". Otherwise, with the "swipe" function, you can not enable the "developer mode")
Connect your device into a PC (Assume that's a Ubuntu platform environment).
To verify the connection, use adb to display currently connected devices:
$ adb devices
List of devices attached
025d138e2f521413 device
- Install phablet-tools package
Ensure the universe archive is enabled, then:
$ sudo apt-get install phablet-tools
- Enabling read-write mode:
$ phablet-config writable-image
The system reboots in read-write mode.
- Disabling read-write mode: You can disable read-write and restore automatic over-the-air updates:
$ adb shell rm /userdata/.writable_image
To restore the normally read-write protected system area to a pristine state that does not include any changes you made while in read-write mode by installing the Ubuntu system:
$ ubuntu-device-flash touch --channel=CHANNEL
Sources: https://developer.ubuntu.com/en/start/ubuntu-for-devices/installing-ubuntu-for-devices/#install-options
Advises: Up to now, it's not a good idea to use "apt-get" as they (Mr.Popey) said:
"We don't test apt-get installed scenarios on the phone and if you use apt-get upgrade, you may install packages which haven't yet been fully tested as part of image based updates"
Source: How to install a .deb file in Ubuntu-Touch?
- 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.
- Your system will become slowly broken - see above.