background_background_header@2x.webp
raspberry pi
Ubuntu Touch on Raspberry Pi 3B+

# Ubuntu Touch

Authors: Mark from UBports RPi fluffychat channel
Contact: info@ubports.com
Category: #OS
Where to get it: ubports-roofts-rpi

How to install and help to test!

I've used Raspian on the Raspberry Pi 4 to prepare the image. More or less the same procedure will work with most Linux desktop distributions. Feel free to use whatever software you are used to or you prefer. I've previously used Ubuntu 18:04 on an old desktop computer. It is also possible from Microsoft Windows or Macs – I have neither but if anyone wants to add instructions for them please do so.

Requirements

Raspberry Pi 3B+ and a good power supply, Micro SD card (8-32GB), card reader in desktop or laptop computer (or a Raspberry Pi running Linux), USB keyboard and mouse, HDMI monitor/TV and cable, Ethernet connection and cable.

Get and extract the Ubuntu Touch (UT) image

On your computer look for the latest image on https://ci.ubports.com/job/rootfs/job/rootfs-rpi/

Once you have opened the website in a browser click on ubuntu-touch-raspberrypi.img.xz and save the file on your computer. I saved it in Downloads.

Note: If using SD Card Copier on the Raspberry Pi or Gnome Discs you do not have to unzip the file first so the next bit is out of date now. I'll post clearer instructions and update the screenshots soon.

The image is compressed so needs to be unzipped. You should be able to do that in your file manager. Navigate to the Downloads folder (or whichever folder you used), identify the file, right click on it and choose extract from the options. It will take a little time to extract the 4GB image.



Write image to SD card

Doing this needs a little bit of using the Terminal or try using another tool depending on the OS you are using on your PC. In our case put the card in the card reader. Next you have to find the card. Open the terminal and type in: $ sudo fdisk -l

$ sudo fdisk -l



In my case this showed that /dev/sda  was the 32GB card. To write the image to the card simply change directory to where you saved the file (in my case typing $ cd Downloads in the terminal got me there) then, still in the terminal, type in:

$ sudo dd bs=4M if=ubuntu-touch-raspberrypi.img of=/dev/sda conv=fsync

*Please replace /dev/sda with the correct path to your SD card.

Running DD on a 4GB file will take several minutes. Once it has finished you can close the terminal.

Expand the partitions

You now need to use the whole SD card. I used Gparted to do this. Launch Gparted and give it time to read the disks and partitions in your system. Use the drop down list to shift to your SD card. There should be two partitions on your SD card, in my case sda1 and sda2.

You will see that most of it is unallocated. To change this first unmount the partitions. Right click on them and select unmount Then select the main (largest) partition and choose the Resize/Moveoption. Drag the right of the partition to the far right hand side leaving zero free space before and after it.

Then select Apply all operations and click Apply. Once that is finished the card should be ready for the Raspberry Pi. Close Gparted then safely remove the card.


Preparing the Pi

Disconnect the power supply from the Pi, make sure the HDMI, Ethernet, keyboard and mouse are all connected. Put the SD card in, turn on the monitor then reconnect the power supply. At this point it should go through the start-up process and after a minute or two it should launch into UT setup. If it does not you may have to rewrite the card.

First run

The next stage is slightly tricky as mouse selection is currently odd. The area screen should appear. Select your language and click next.

You might be lucky, as simply moving the mouse over the selection then clicking usually works. If it doesn't don't worry there are little 'tricks' that can help. When the mouse pointer seems trapped within an invisible rectangle on the screen moving it around in increasing circles for a few seconds will free it. Most things can be selected by using tab and return on the keyboard. If you are having trouble selecting a particular area with the mouse, moving the cursor backwards and forwards horizontally a couple of times before selecting usually works (for some selections it needs to be moved vertically - trial and error will teach you what works where). It tends to want to select the previous selected area if you don't do the horizontal or vertical movements first and sometimes you need to click a couple of times to get it selected.

Next select your keyboard language and click next. Under Time zone type in your nearest big city then select and click next. If you do not have a working internet connection you may get stuck here. Lastly type in a preferred name. You should now get the UT Welcome screen and can select Get Started to enter.

Hopefully you now have a working (but slow and not very responsive) Pi running UT. The default login and password are both phablet.

Swap and ZRAM

The Pi 3 is quite low spec, once issues are sorted the 2-4GB Pi 4 will run UT much more smoothly. Adding Swap and ZRAM on the Pi 3 are not great for the long life of an SD card so you should do the following if that isn't a major concern for you.

Type the command below into the terminal if you want a swap partition of 2GB. This will take quite a long time, wait for it to finish

$ sudo apt-get install dc dphys-swapfile

Typing the next command in the terminal should now show the swap.

$ free -m

Again in the terminal type:

$ sudo apt-get install zram.config
then once it has completed restart to make it work.

$ sudo reboot
Logging in

Pressing TAB then typing phablet and hitting return is perhaps the quickest way to login.

What now?

By now you might be getting annoyed at the Pi shutting the screen down regularly. Find the Battery Settings and change Lock when Idle to 10 minutes or Never. OpenStore is the preferred place to get and update software. Clickable is another option.

UT Tweak Tool is vital to give you more choices than standard settings allow. Docviewer lets you access many file formats. Dekko brings you email. Logviewer gives you the information needed to help report issues and work out how to fix them. TELEports lets you easily access Telegram. You can use the Morph Browser to access the UBports forums and Github. As the Pi image is based mostly on Edge channel some apps in the OpenStore have not yet been updated and will fail to launch. Using apt update and apt upgrade may break the system. You can use DD to make backups of your card or just backup your Home directory so you have most of your data safe.
s
If using TELEports go into its settings and turn off notifications if you are part of busy groups like the PinePhone one otherwise the system briefly hanging every time a notification comes in will start to annoy. Expect more crashes if you try to work with lots of open apps and browser tabs - treat it gently and it is quite stable and responsive.

How to improve things

Many things are not yet working. As PinePhone and other arm64 devices develop on UT this will help solve some of the issues. Others will need people to compare Raspian and other Pi based OS to see how they get things like audio, WiFi, Bluetooth, camera and selection working. Logviewer lets you easily inspect and copy relevant parts of logs and copy and paste them or put them in pastebin to help with reporting issues. Using Ctrl C and Ctrl V make copying and pasting a bit simpler at the moment. Your keyboard Print Screen button should work to get screenshots of issues.

Touch screen works quite well if you are lucky enough to have one and makes selection so much easier. Wireless keyboards and mice that I have tried work well.

Join in discussions on the Telegram group https://t.me/UBports_pi and report issues on Gitlab https://gitlab.com/ubports/community-ports/raspberrypi/issues

Info on app development can be found in the forums https://forums.ubports.com/topic/3323/arm64-apps-and-testing

I'm not a developer and the UBports core developers only have very limited time to put towards the Pi at present so any community involvement is welcome. If there is anything we can do ourselves that then feeds back into improvements for other users of arm64 devices that strengthens the operating system and if we can help to get it stable enough to be a solid and affordable development platform for UT apps that should help everyone. At present it can be a little frustrating to use but things are improving all the time.
Development:

https://gitlab.com/ubports/core/rootfs-builder-debos and the multiple deb packages that are used are built on ci.ubports.com with the source on github.com/ubports/

The build "scripts" can be found here: https://gitlab.com/ubports/core/rootfs-builder-debos/blob/master/raspberrypi.yaml please send PRs here to improve the images.

    What do you think?

    Explore and help to test and develop Ubuntu Touch on Raspberry Pi.

                      background_background_header@2x.webp
                      Ubuntu Touch Q&A 48
                      The Apirl Highlights