raspberry pi 2B (1) - HelloMorningStar/HomeAssistant GitHub Wiki

https://www.raspberrypi.org/products/raspberry-pi-2-model-b/
i've got a second hand rapberry pi 2B, and i want to try download ubuntu18.04 in it.
let's do it!

reference: Install ubuntu18 on pi2b and pi3b/b+
pi2 download: download

installation

1) download above ubuntu image, then unzip downloads to get the image file

2) writing a image to the microSD card

1- prepare for sd card How to chose a microSD card? try samsung 32g evo+ or evo plus, evo + is more suitable for raspberry.
2- 5V power supply and good mini usb cable(not use cheap power supply or cable)
3- download sd card writing tool(balenaEtcher)

3) first boot

the first boot needs a working Ethernet connection.
the login username and password is "ubuntu"

4) optional PPAs

sudo add-apt-repository ppa:ubuntu-raspi2/ppa
sudo apt-get update

Further/updated Raspberry Pi packages can be found in the Ubuntu Pi Flavour Maker PPA. Many of these packages rely on the user being a member of groups:
sudo groupadd -f --system gpio
sudo groupadd -f --system i2c
sudo groupadd -f --system input
sudo groupadd -f --system spi

5) choose an desktop

This is a small ubuntu-server image. If you want a full desktop, go ahead and do so:
$ sudo apt-get install xubuntu-desktop # or
$ sudo apt-get install lubuntu-desktop # or
$ sudo apt-get install kubuntu-desktop # etc
if u have any confuses, please reference this link it's about those desktops differents. i have choosen xubuntu that is a Xfce desktop for older or lowercpu like raspberry pi 2B, because i'd like never to use it.

6) Accelerated X driver and VideoCore

$ sudo apt-get update && sudo apt-get install xserver-xorg-video-fbturbo #not successful

7) Create a swap partition

The Raspberry Pi 2 has 1Gb of RAM; to tackle the massive Ubuntu, installing a swap partition is a good thing. Type in https://www.raspberrypi.org/forums/viewtopic.php?t=233794
https://linuxize.com/post/how-to-add-swap-space-on-ubuntu-18-04/

sudo swapoff -v /swapfile
Next, remove the swap file entry /swapfile swap swap defaults 0 0 from the /etc/fstab file.
sudo rm /swapfile

8) shift into command or windows after power on

see link
sudo systemctl set-default multi-user.target
startx
sudo systemctl set-default graphical.target
ctrl+alt+F7 #shift into command
ctrl+alt+F2 #shift into windows

9) trouble shorting

booting error


you just edit
sudo nano /lib/modules-load.d/open-iscsi.conf
and remark ib_iser.

Error found when loading /root/.profile

mesg: ttyname failed: Inappropriate ioctl for device As result the session will not be configured correctly. You should fix the problem as soon as feasible.
nano /root/.profile

tty -s && mesg n || true

good luck for u!