January 22, 2016 How to install Ubuntu 14.04 on Raspberry Pi 2

Raspberry PI 2 Ubuntu

Technical description about RASPBERRY PI 2 MODEL B here

Prepare Micro SD card

You need Micro SD card. Use Class 10 for better performance. The minimum recommend size for SD card is 8GB. Raspberry PI 2 works with cards up to 32GB. Before you start using Micro SD card, please check Working / Non-working SD cards list for your SD card Part Number.

Completely erase all data on a micro SD card

Insert SD card to card reader and find you card id with lsblk tool. lsblk tool will show you something like:

lsblk
NAME   MAJ:MIN RM   SIZE RO TYPE MOUNTPOINT
sda      8:0    0 465.8G  0 disk 
├─sda1   8:1    0   1.9G  0 part [SWAP]
├─sda4   8:4    0     1K  0 part 
├─sda5   8:5    0  46.6G  0 part /var/www
├─sda6   8:6    0 278.1G  0 part /media/storage
└─sda7   8:7    0 139.2G  0 part /
sdb      8:16   1    15G  0 disk 
└─sdb1   8:17   1    15G  0 part /media/luxurydab/9016-4EF8

where sdb is your micro SD card

Unmount your card

sudo umount /dev/sdb1

Run dd command that will completely erase all data on a micro SD card

sudo dd bs=4M if=/dev/zero of=/dev/sdb && sync

Erase will take some time. If you want to see erase progress send USR1 signal to dd tool from another one terminal window

sudo kill -USR1 $(pgrep ^dd)

Install Ubuntu

Now you can download and put ubuntu image to your micro SD card. Let's download iso and unzip it

cd /tmp
wget http://www.finnie.org/software/raspberrypi/2015-04-06-ubuntu-trusty.zip
unzip 2015-04-06-ubuntu-trusty.zip

You can verify downloaded iso

wget http://www.finnie.org/software/raspberrypi/2015-04-06-ubuntu-trusty.zip.asc
gpg --keyserver x-hkp://pool.sks-keyservers.net --recv-keys 86AE8D98
gpg --verify 2015-04-06-ubuntu-trusty.zip.asc

Put image to micro SD card with dd tool

sudo dd bs=4M if=/tmp/2015-04-06-ubuntu-trusty.img of=/dev/sdb && sync

Putting image to card will take some time. If you want to see progress use kill tool again like we do in previous step

sudo kill -USR1 $(pgrep ^dd)

Finally you can insert your micro SD card with Ubuntu image to your Raspberry Pi 2. Use username ubuntu and password ubuntu to login via ssh. Also I want to notice you that always do graceful shutdown of your Raspberry Pi. Use shutdown -h now command to shutdown Raspberry. In case if you will power off Raspberry without command you could get some SD card errors on next boot.

Hardware