Introduction
Raspberry Pi is designed to run on Raspbian, a Debian-based operating system optimized for these devices.
Even though Raspbian comes with more than 30,000 packages and covers most use-cases, power users may find the system restrictive. When users want more updates and a more familiar environment, Ubuntu can be installed.
As Raspberry hardware is a limiting factor in the choice of Ubuntu version, we recommend Ubuntu MATE optimized for the ARM architecture. The distribution of MATE developed for Raspberry Pi is lightweight and less demanding on resources.
In this guide, learn how to install Ubuntu MATE on Raspberry Pi by writing the image to an SD card.
Prerequisites
- A Raspberry Pi device (version 2 or 3)
- An SD/MicroSD card (8GB minimum, 32GB recommended)
- A computer with an SD/MicroSD card reader
- A tool for decompression for the version of OS on your computer
Installing Ubuntu Mate on Raspberry Pi
To install Ubuntu MATE on Raspberry Pi, you need to download an image and write it to an SD card. This process is straightforward.
Once you prepare a bootable SD card to install Ubuntu on Raspberry Pi, the rest of the installation will be familiar. Follow the steps below to boot Raspberry Pi to the Ubuntu MATE desktop.
Note: At the moment, you cannot install Ubuntu on Raspberry Pi 4. Only Raspberry Pi 2 and 3 are supported at the time of writing this article. Ubuntu MATE for Raspberry Pi 4 is yet to be released.
STEP 1: Download Ubuntu MATE for Raspberry Pi
1. Navigate to the Ubuntu MATE download page and select Raspberry Pi (recommended).
2. On the next page, select 18.04.2 (Bionic). This is the only available selection at the time of writing this article.
3. Choose how to download the MATE image. You can use a torrent client, but a direct download is also available:
4. Save the .xz compressed image file to the desired location.
STEP 2: Prepare Ubuntu MATE Image
The Raspberry Pi Ubuntu Mate image comes compressed. The extension of the file you downloaded is .xz. Use your favorite tool to extract the .img file.
To extract the file from a terminal, navigate to the location of the downloaded file and run this command:
xz -d ubuntu-mate-18.04.2-beta1-desktop-armhf+raspi-ext4.img.xz
MacOS users can install The Unarchiver from the App Store and use that tool to extract the image. Find the file and double-click to extract it.
On a Windows machine, use the application of your choice. We recommend 7-Zip. Locate the downloaded file, right-click it, and hover over 7-Zip. Choose where to extract the file. The simplest is to select Extract Here.
STEP 3: Formatting the SD Card
Raspberry Pi uses the FAT32 format for SD cards. All Raspberry Pi models from 2014 onward use a MicroSD card. You need a card reader on your machine to complete further steps.
Use a MicroSD to SD adapter if your reader only accepts full-size SD cards.
The advanced method requires you to format the card, while Etcher will do that for you. To be on the safe side, format the card in any case before continuing.
Format SD Card on Windows
To format an SD card on a Windows machine, you can use Windows Explorer.
1. Insert your SD card and locate it in the Explorer.
2. Right-click the disk volume for your card and select Format…
3. Make sure the file system is set to FAT32. You can leave other options unchanged.
4. Select Start and confirm that you want to format the drive. Of course, all data on the card will be deleted.
5. You will see the confirmation message once the formatting process completes. Click OK and then close the Format tool.
Format SD Card on MacOS
1. Use the Disk Utility on macOS to format an SD card. When you insert the card, open the utility, and locate the card on the list.
2. Once you select the card on the left, click the Erase tab.
3. Choose “MS-DOS (FAT)” from the drop-down list. Click Erase… to format the card.
STEP 4: Write Image to SD Card with Etcher
The easiest method to write the Ubuntu MATE image to an SD card is by using the application Etcher. This tool allows you to write an image to your external drives easily.
Etcher is available for all operating systems: Windows, macOS, and Linux. Visit the Etcher download page and download the version for your machine. Install the tool and run it.
1. First, select the Ubuntu MATE image you downloaded earlier.
2. Second, select a drive. Click the drive icon and select your SD card from the list and click Continue.
3. Finally, click Flash and let the tool complete the process. This may take some time, depending on the speed of your SD card.
4. When Etcher finishes flashing the image to your card, you will see the Flash Complete message. Close the app and eject the card from the computer.
Note: Alternatively, if you are looking for a tutorial on installing Etcher on Ubuntu, visit our article How To Install Etcher On Ubuntu. The guide offers two possibilities, via GUI and via terminal.
Advanced: Write Ubuntu MATE to SD Card Using Terminal
STEP 5: Launch Ubuntu MATE Installation
Insert the SD card in your Raspberry Pi before you turn it on. Connect all cables if you have not already and let the device boot up.
The installation procedure is similar to any other Ubuntu installation. Continue by selecting the keyboard layout, location, network, username, and password.
Let the installation complete, and you will soon see the Ubuntu Mate desktop.
Instead of using Etcher, you can use the terminal to write the image to an SD card on Linux and macOS machines. Make sure to have the card formatted, as explained in the previous steps.
1. To write the Ubuntu MATE image, open the terminal and navigate to its location. In our case, it is the Downloads directory:
cd Download
2. Use the dd
command to write to the card. You need the exact drive location so you can direct the tool where to write.
The full command with the current Ubuntu MATE image name and a drive location is:
sudo dd bs=1m if=ubuntu-mate-18.04.2-beta1-desktop-armhf+raspi-ext4.img of=/dev/rdisk1 conv=sync
Make sure you use the name of the image you downloaded and your drive path instead of our /dev/rdisk1.
3. Eject the SD card from your computer when the process completes.
STEP 6: Update Ubuntu MATE
Once the system fully loads on your Raspberry Pi, you need to run the updater to make sure the software is updated.
To do so, open the terminal and run the update
and upgrade
commands.
sudo apt update
sudo apt upgrade
If you prefer using Ubuntu’s Software Updater, you can check for updates using its GUI.
Select what you want to install and click Install Now.
Your Raspberry Pi with Ubuntu MATE is now ready for use.
Conclusion
Note: Are you looking for other Raspberry Pi tutorials? Don’t forget to check out our tutorial on how to install Java on Raspberry Pi.
This tutorial showed you how to install Ubuntu MATE on Raspberry Pi 2 and 3. If you followed the steps in this guide, you now know how to prepare an SD card for writing an image file.
You also learned how to use Etcher and the terminal to write Ubuntu MATE to an SD card. As a reminder, Ubuntu on Raspberry Pi 4 is not supported yet.
原创文章,作者:kirin,如若转载,请注明出处:https://blog.ytso.com/tech/dev/223220.html