Ubuntu MATE on Raspberry Pi

I’ve been wanting to try out a Linux desktop for a while now. Mainly out of curiosity – I like to try new devices, operating systems, etc. I didn’t really want to invest in a computer just to try out a new OS, however. I had a couple older MacBooks lying around but I also had a Raspberry Pi 3 that I hadn’t quite decided what to do with. After poking around a bit on the internet, I found desktop variant Ubuntu MATE had been optimized for the use with the Raspberry Pi 2 & 3. The installation process looked pretty straightforward and I had an extra monitor, keyboard, and mouse so I figured I’d give it a try!

Note that I decided to try this solely to test out and explore Ubuntu MATE. A single Raspberry Pi probably isn’t ideal for your main working machine, especially if you’re more of a power user or developer. It’s not super fast but I do find it great for explorational purposes.

What you’ll need before starting

Before moving forward, you’ll need the following items:

  • A Raspberry Pi 3
  • A class 6 or class 10 microSD card (Make sure you get a microSD, not a full-size SD … initially, I made the mistake of ordering a SD card because I wasn’t paying attention)
  • An external monitor
  • A USB keyboard
  • A USB mouse
  • (optional) If you’re using a Raspberry Pi 2, you may want/need a WiFi USB adapter. Otherwise, you can connect via an ethernet wire. The Raspberry Pi 3 has WiFi and Bluetooth built in.

Preparing the microSD card

Download the latest Ubuntu Mate image from https://ubuntu-mate.org/download/.

You will want to click and expand the LTS option and you will see the Raspberry Pi specific download option from there.

Now if you are on Linux or Mac use the dd tool to write the image to a microSD card.

First, verify which disk is your target microSD card. On Linux, use lsblk to list all bulk storage devices. If you’re on a Mac, check which disk you need with sudo diskutil list.

Tip: If you are unsure which drive is your flash drive, you can type the command in your Terminal with the drive not inserted. Then run the command again with the drive inserted to verify which one it is. In the code examples below, you’ll need to replace (IMG_FILE) with the path of your unzipped ubuntu mate image and (DEVICE_PATH) with the path of your microSD card.

Now, unmount the target volume using the following command, replacing the identifier as appropriate:

sudo umount (DEVICE_PATH)

Note that you’ll need the path to the disk identifier. For example, when I ran sudo diskutil list list, I was presented with the following:

/dev/disk0 (internal):
 #: TYPE                  NAME          SIZE       IDENTIFIER
 0: GUID_partition_scheme               1.0 TB     disk0
 1: EFI                   EFI           314.6 MB   disk0s1
 2: Apple_CoreStorage     Macintosh HD  999.6 GB   disk0s2
 3: Apple_Boot            Recovery HD   650.0 MB   disk0s3

/dev/disk1 (internal, virtual):
 #: TYPE                  NAME          SIZE       IDENTIFIER
 0:                       Macintosh HD  +999.3 GB  disk1
                          Logical Volume on disk0s2
                          Unlocked Encrypted

/dev/disk2 (external, physical):
 #: TYPE                  NAME          SIZE       IDENTIFIER
 0: GUID_partition_scheme               *3.9 GB    disk2
 1: EFI                   EFI           209.7 MB   disk2s1
 2: Microsoft Basic Data  MyMicroSD     3.7 GB     disk2s2

Since I need to target the MyMicroSD drive, the command would look like the following (also note that the command is umount, not unmount, which is slightly confusing):

sudo umount /dev/disk2s2

If you try that and get a “Resource busy — try ‘diskutil unmount'” notice, try the following (making sure you are targeting the correct drive):

diskutil unmount /dev/disk2s2

With that, you’re now ready to format your drive write the image to your microSD card.

Note: this will erase all data on the target drive replacing it with the ISO. This can not be undone, so it is critical that you target the proper identifier (see above step) to avoid unintended data loss.

With the proper image path (IMG_FILE) and path to your microUSD card (DEVICE_PATH), run the following command:


$ sudo dd if=(IMG_FILE) of=(DEVICE_PATH) bs=1m


$ sudo dd if=(IMG_FILE) of=(DEVICE_PATH) BS=1m

This process can take a while so don’t worry if nothing seems to be happening in your Terminal window. Now might be a good time to go gab a beverage and give it a little bit of time to complete. Once it finishes and you see your prompt again, you can safely eject your drive.

Windows Users

For Windows, there is a Windows version of dd available on this site.

There is also a graphical tool for Windows called Win32 Disk Imager, which you can download here. If you prefer to use the graphical tool, open the downloaded .exe file and, in the “image file” field, you’ll need to select the image file (unzipped). In the “device” field, you’ll need to select the Drive Letter of the microSD card.

Installing Ubuntu MATE on your Raspberry Pi 2/3

Now at you have your microSD card ready to go, you can pop it in to your Raspberry Pi and plug your Pi into a power source (along with a monitor, keyboard, and mouse). I am using a Raspberry Pi 3 so I was able to connect to WiFi after installation. If you’re on a Pi 2, you will likely need to connect via ethernet or have an aforementioned WiFi USB adapter. Your Raspberry Pi will power right up and begin the installation process. After it boots up, you’ll be presented with options to choose your language, time-zone, and desired keyboard layout. After that, you will be prompted to create a user account, from which you can log in.

That’s all there is to it – have fun exploring Ubuntu MATE!

React.js Resources

Recently I’ve been digging into React.js. Some my awesome co-workers are experimenting and utilizing the library in some pretty cool ways, so it really sparked my interest. As a result, I’ve collected a little list of bookmarks that I thought was worth sharing:

I’m currently in the process of working my way through these and I will likely update this post as I discover more resources. That said, please do share in the comments, if you know of any good ones that I’ve missed!

* List last updated on 04/01/2015

Yoda Conditional Statements

Here’s a little gem on conditional statements that I saw for the first time in the WordPress Coding Standards a few months ago. When writing out a conditional logic, it is recommended to place the variable on the right side of the comparison operator and the constants or literals on the left. Appropriately named “Yoda Conditions”, as the statement then reads backwards to how we would typically speak or think. I’ve never really thought about this before but it really is a handy little tip.

Take the following example (from the handbook):

if ( true == $the_force ) {
    $victorious = you_will( $be );

Despite that it reads backwards, this makes sense programatically. If you were to accidentally omit a part of the comparison operator (an equals sign, for example) when writing out your statement, your code would fail because you can’t assign to a constant. Writing your conditional the other way around (non-Yoda) would evaluate to true via an accidental assignment operator. This would result in perfectly valid code and a bug that is much more difficult to track down.

Note that this only applies to ==, !=, ===, and !== comparisons. As stated in the handbook, “Yoda conditions for <, >, <= or >= are significantly more difficult to read and are best avoided.”

Moving Local Files with Rsync

I am very obsessive about backing up my data. To preserve space on my MacBook Air’s drive, I store most of media files on a WD Passport external drive. Additionally I back that media up on a second (and oftentimes a third) desktop external drive. Sure, this is a little OCD but it’d be quite a shame to lose all of my files, should my first Passport drive fail me.

Continue reading “Moving Local Files with Rsync”