We will download the image from the official website of Ubuntu Mate
userk@dopamine:~/Downloads$ wget http://fra.ubuntu-mate.net/raspberry-pi/ubuntu-mate-16.04-desktop-armhf-raspberry-pi.img.xz
Ok, once the download has finished, get an uSD card with at least 8Gb of storage capacity and Class 10 microSDHC and get ready to write the image to it.
Run this command:
userk@dopamine:~$ df -h
/dev/sdX1 15G 288K 15G 1% /media/userk/6564-6637
Now, insert the uSD in the internal or external reader, and rerun the above command. The new discovered device is your uSD, it should look like this /dev/sdX.
Please write you situation as comment. We will help you out.
You can now unmount the device in order to be able to write to it. We will assume that the device name is /dev/sdX. Change it to match yours.
userk@dopamine:~$ sudo umount /dev/sdX
userk@dopamine:~$ ls | grep mate
ubuntu-mate-16.04-desktop-armhf-raspberry-pi.img.xz
userk@dopamine:~$ unxz -v -k ubuntu-mate-16.04-desktop-armhf-raspberry-pi.img.xz
ubuntu-mate-16.04-desktop-armhf-raspberry-pi.img.xz (1/1)
1,0 % 11,2 MiB / 193,0 MiB = 0,058 0:01
4,6 % 50,3 MiB / 261,9 MiB = 0,192 0:02
The official website recommends to check the correctness of the image written by writing it back from the uSD to a new image file of the disk and check the differences. It is a good habit.
userk@dopamine:~/Downloads$ sudo dd bs=4M of=ubuntu-mate.img if=/dev/sdc status=progress
15918071808 bytes (16 GB, 15 GiB) copied, 774,178 s, 20,6 MB/s
3798+2 records in
3798+2 records out
15931539456 bytes (16 GB, 15 GiB) copied, 774,91 s, 20,6 MB/s
ENTER
[1]+ Done sudo dd bs=4M of=ubuntu-mate.img if=/dev/sdc status=progress
userk@dopamine:~/Downloads$ sudo truncate --reference ubuntu-mate-16.04-desktop-armhf-raspberry-pi.img ubuntu-mate.img
[sudo] password for userk:
userk@dopamine:~/Downloads$ diff -s ubuntu-mate.img ubuntu-mate-16.04-desktop-armhf-raspberry-pi.img
Files ubuntu-mate.img and ubuntu-mate-16.04-desktop-armhf-raspberry-pi.img are identical
userk@dopamine:~/Downloads$ sync
Ok, almost finished. The last step is to connect to the Rpi via SSH and test if everything worked well. Insert the uSD card in the Raspberry Pi 3 or 2 and plug in the ethernet cable. Wait 2 or 3 minutes and run the following commands from your laptop (I assume you are running an Ubuntu version but other GNU/Linux distribution are ok as well)
userk@dopamine:~$ sudo apt-get install nmap
userk@dopamine:~$ ifconfig
192.168.1.XX
userk@dopamine:~$ nmap 192.168.1.*
Nmap scan report for ubuntu-mate.********.*** (192.168.1.44)
Host is up (0.015s latency).
All 1000 scanned ports on ubuntu-mate.*********.*** (192.168.1.44) are closed
Since all the ports are closed by default, you need a hdmi monitor, a keyboard and a mouse use your system for the first time.
Hope it helps