I find the UT Linux structure both interesting and odd



  • Hello. I was pleased to discover that some Ubuntu APT packages can be installed and run on the command line. I have installed a few small command line programs, via using the command "sudo mount -o rw,remount /" (as described in the instructions on setting up Anbox, and then returning the system back to "sudo mount -o ro,remount /".

    But I noticed that this is surprisingly limited. I began gettng the error, "E: You don't have enough free space in /var/cache/apt/archives/." So, I attempted to clear space with "apt autoclean" and "apt clean", but to no avail.

    Then, I checked out the directory "/var/cache/apt/archives/", and there doesn't seem to be anything in it. I'm not even sure that this directory exists. It seems to be a phantom directory, residing at "/dev/loop0":

    blet@ubuntu-phablet:~$ df -hT
    Filesystem                     Type      Size  Used Avail Use% Mounted on
    udev                           devtmpfs  766M  4.0K  766M   1% /dev
    tmpfs                          tmpfs     186M  1.7M  184M   1% /run
    /dev/mmcblk0p28                ext4       13G  3.8G  8.3G  32% /userdata
    /dev/loop0                     ext2      2.0G  1.9G     0 100% /
    /dev/loop1                     ext4      110M  106M  4.3M  97% /android/system
    none                           tmpfs     4.0K     0  4.0K   0% /android
    tmpfs                          tmpfs     929M  4.0K  929M   1% /etc/fstab
    tmpfs                          tmpfs     929M  1.1M  928M   1% /var/lib/lxc/android/rootfs
    /dev/disk/by-partlabel/cache   ext4      690M   13M  678M   2% /android/cache
    /dev/disk/by-partlabel/persist ext4       16M  4.2M   12M  27% /android/persist
    /dev/disk/by-partlabel/modem   vfat       64M   45M   20M  70% /android/firmware
    none                           tmpfs     4.0K     0  4.0K   0% /sys/fs/cgroup
    tmpfs                          tmpfs     929M  1.0M  928M   1% /tmp
    none                           tmpfs     5.0M     0  5.0M   0% /run/lock
    none                           tmpfs     929M  228K  928M   1% /run/shm
    none                           tmpfs     100M     0  100M   0% /run/user
    cgmfs                          tmpfs     100K     0  100K   0% /run/cgmanager/fs
    tmpfs                          tmpfs     929M     0  929M   0% /media
    tmpfs                          tmpfs     929M     0  929M   0% /var/lib/openvpn/chroot/tmp
    tmpfs                          tmpfs     929M     0  929M   0% /var/lib/sudo
    tmpfs                          tmpfs     186M     0  186M   0% /run/user/0
    tmpfs                          tmpfs     186M   36K  186M   1% /run/user/32011
    tmpfs                          tmpfs     186M     0  186M   0% /run/user/65534
    phablet@ubuntu-phablet:~$ sudo du -hsc /var/cache
    [sudo] password for phablet: 
    73M	/var/cache
    73M	total
    phablet@ubuntu-phablet:~$ df -hT /var/cache
    Filesystem     Type  Size  Used Avail Use% Mounted on
    /dev/loop0     ext2  2.0G  1.9G     0 100% /
    phablet@ubuntu-phablet:~$ ls /dev/loop0
    /dev/loop0
    phablet@ubuntu-phablet:~$ ls -l /dev/loop0
    brw-rw---- 1 root disk 7, 0 Dec  7 19:10 /dev/loop0
    phablet@ubuntu-phablet:~$ ls /var/cache/apt/archives/
    lock  partial
    phablet@ubuntu-phablet:~$ ls -l /var/cache/apt/archives/
    total 4
    -rw-r----- 1 root root    0 Dec  7 18:04 lock
    drwx------ 2 root root 4096 Dec  7 18:49 partial
    phablet@ubuntu-phablet:~$ cd /var/cache/apt/archives/
    phablet@ubuntu-phablet:/var/cache/apt/archives$ cd partial\
    > 
    bash: cd: partial: Permission denied
    phablet@ubuntu-phablet:/var/cache/apt/archives$ cd partial
    bash: cd: partial: Permission denied
    phablet@ubuntu-phablet:/var/cache/apt/archives$ 
    phablet@ubuntu-phablet:/var/cache/apt/archives$ sudo du -hsc /var/cache/apt/archives
    8.0K	/var/cache/apt/archives
    8.0K	total
    phablet@ubuntu-phablet:/var/cache/apt/archives$ sudo du -hsc /var/cache/apt/
    65M	/var/cache/apt/
    65M	total
    phablet@ubuntu-phablet:/var/cache/apt/archives$ cd ..
    phablet@ubuntu-phablet:/var/cache/apt$ ls
    archives  pkgcache.bin  srcpkgcache.bin
    phablet@ubuntu-phablet:/var/cache/apt$ ls -l
    total 65788
    drwxr-xr-x 3 root root     4096 Dec  7 18:49 archives
    -rw-r--r-- 1 root root 33659744 Dec  8 02:59 pkgcache.bin
    -rw-r--r-- 1 root root 33618288 Dec  8 02:59 srcpkgcache.bin
    phablet@ubuntu-phablet:/var/cache/apt$ 
    
    
    

    /var/cache doesn't seem to have a huge amount in it. And /var/cache/apt/archives has practically nothing in it. 8.0K is too much disk usage? Leading to a not enough space error? I think not.

    Though /dev/loop0, which the df command cited when I asked about /var/cache/apt/archives, says it has no space. I'm not sure what /dev/loop0 actually is, though. It's not a directory. Strange.



  • The rootfs is readonly for a reason. So apt is not a supported method of installing packages. If there are CLI or legacy apps you need to run on the phone, the supported method of doing this is through a libertine container.

    The rootfs is an image file, and so it is loopback mounted.



  • The Libertine container didn't work with commandline programs. I'm guessing the Libertine container is more for the convergence aspect of UT.



  • I am not sure what didn't work for you concerning command line programs in Libertine. The UBports documentation mentions that doing so is possible and has a cool trick to make the experience more seamless.

    For a more step by step description of the process you could go here.

    Lastly, the purpose of a Libertine container is to offer the possibility to install programs from the Ubuntu archives in a 'traditional' way, i.e. via apt. But that does not directly contribute to the 'convergence aspect' of UT. Now convergence means different things to different people, but at the very least it would include the idea that applications are built with a UI to adapt to different form factors. In the case of Libertine, all it does is allow you to install applications from the repositories. Most, if not all, of these programs have not been written with different form factors in mind, so by definition they would not be convergent.



  • @arubislander I've been trying to follow your advice, but without luck. I set up a Libertine container, and tried to install a few command line programs (both via the GUI on the phone and on the command line) and neither has worked. From the command line, here is what I get when I try to install a simple command line calendar (and note, I have installed calcurse successfully in the past using apt --> in a previous setup of Ubuntu Touch, though not on this setup of it):

    phablet@ubuntu-phablet:~$ libertine-container-manager install-package -p calcurse
    Err:1 http://ports.ubuntu.com/ubuntu-ports xenial InRelease
      Temporary failure resolving 'ports.ubuntu.com'
    Err:2 https://repo.ubports.com xenial InRelease
      Could not resolve host: repo.ubports.com
    Err:3 http://ports.ubuntu.com/ubuntu-ports xenial-updates InRelease
      Temporary failure resolving 'ports.ubuntu.com'
    Reading package lists...
    W: Failed to fetch http://ports.ubuntu.com/ubuntu-ports/dists/xenial/InRelease  Temporary failure resolving 'ports.ubuntu.com'
    W: Failed to fetch http://ports.ubuntu.com/ubuntu-ports/dists/xenial-updates/InRelease  Temporary failure resolving 'ports.ubuntu.com'
    W: Failed to fetch https://repo.ubports.com/dists/xenial/InRelease  Could not resolve host: repo.ubports.com
    W: Some index files failed to download. They have been ignored, or old ones used instead.
    Reading package lists...
    Building dependency tree...
    Reading state information...
    The following package was automatically installed and is no longer required:
      libpcre16-3
    Use 'sudo apt autoremove' to remove it.
    The following NEW packages will be installed:
      calcurse
    0 upgraded, 1 newly installed, 0 to remove and 1 not upgraded.
    Need to get 193 kB of archives.
    After this operation, 746 kB of additional disk space will be used.
    Err:1 http://ports.ubuntu.com/ubuntu-ports xenial/universe armhf calcurse armhf 4.0.0-1
      Temporary failure resolving 'ports.ubuntu.com'
    E: Failed to fetch http://ports.ubuntu.com/ubuntu-ports/pool/universe/c/calcurse/calcurse_4.0.0-1_armhf.deb  Temporary failure resolving 'ports.ubuntu.com'
    
    E: Unable to fetch some archives, maybe run apt-get update or try with --fix-missing?
    Reading package lists...
    Building dependency tree...
    Reading state information...
    The following package was automatically installed and is no longer required:
      libpcre16-3
    Use 'sudo apt autoremove' to remove it.
    0 upgraded, 0 newly installed, 0 to remove and 1 not upgraded.
    libertine-container-manager:184: ERROR: install_package():	Package 'calcurse' failed to install in container 'xenial'
    phablet@ubuntu-phablet:~$ 
    
    phablet@ubuntu-phablet:~$ libertine-launch -i xenial calcurse
    proot error: 'calcurse' not found (root = /home/phablet/.cache/libertine-container/xenial/rootfs, cwd = /home/phablet, $PATH=/home/phablet/bin:/home/phablet/.local/bin:/home/phablet/bin:/home/phablet/.local/bin:/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin:/snap/bin:/usr/games)
    fatal error: see `proot --help`.
    phablet@ubuntu-phablet:~$ 
    
    
    

    So, I'm not sure what I'm doing wrong.



  • @MarkG_108 said in I find the UT Linux structure both interesting and odd:

    Temporary failure resolving 'ports.ubuntu.com'

    Just to geht the obvious out of the way: You are connected to the internet, right?

    Is your UT up to date? I remember some libertine fixes a while ago.

    Lastly, if you are connected and up to date, maybe something is off with your container. Could you try with a new one?



  • @doniks said in I find the UT Linux structure both interesting and odd:

    Just to geht the obvious out of the way: You are connected to the internet, right?

    My WiFi was on, but my data was turned off. I've discovered that with UT, connecting to the internet via WiFi alone doesn't seem to work now (at least on my phone at present). By comparison, on my old Galaxy Nexus, running LineageOS 13, which now has no SIM card (and I intentionally turned off the cell data), it can still access the internet via WiFi.



  • To add, my phone has been acting rather unusual lately. I restarted it and now the contacts are wiped out. I tried re-importing the contacts.vcf file, but was unable to. [edit] Well, I think there were just some cobwebs in the phone. I solidly turned it off and on a couple of times (rather than merely restarting it), and now things seem more back to normal (at least my contacts have returned). I'll try again with Libertine and see.



  • @doniks, Okay, time for attempt #2. First, cellular data is off, but WiFi is on, so there is internet access. And the system is up to date.... okay, great, it worked this time. Thanks for your help.


Log in to reply