kbarre123

My online journal.

Building the Arduino IDE From Source and Launching It From the Applications Menu on Linux Ubuntu

| Comments

Ubuntu is great, but their Software Center doesn’t always offer the most up-to-date builds. Here’s step-by-step instructions on building the Arduino IDE from source and adding it to the Applications menu for easy launching.

The convenience of installing software through the Ubuntu Software Center is that you’ll receive updates via $ sudo apt-get update; sudo apt-get upgrade, along with the fact that all of the behind-the-scenes work of adding the program to your system’s menu is handled for you. The down-side is, at the time of publication, the version of the Arduino IDE offered by the Software Center was 1.0.5+dfsg2-2. That bad-boy was last updated January 8, 2014, which is about 14 months and 20 releases ago. Granted, I’ve been using that build since it came out and have never had any issues with it at all, but it was time for an upgrade to the latest and greatest.

Step #1

Check and see which version the Ubuntu Software Center is currently offering. If its something you can live with, install it through the Software Center and move on with your life. If its not the one you want, proceed to step #2.

Check the version offered through the Ubuntu Software Center
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
kcb@ubuntu$ apt-cache show arduino
Package: arduino
Priority: optional
Section: universe/electronics
Installed-Size: 1687
Maintainer: Ubuntu Developers <ubuntu-devel-discuss@lists.ubuntu.com>
Original-Maintainer: Scott Howard <showard@debian.org>
Architecture: all
Version: 1:1.0.5+dfsg2-2
Depends: default-jre | java6-runtime, libjna-java, librxtx-java (>= 2.2pre2-3), arduino-core (= 1:1.0.5+dfsg2-2)
Recommends: extra-xdg-menus, policykit-1
Filename: pool/universe/a/arduino/arduino_1.0.5+dfsg2-2_all.deb
Size: 1164058
MD5sum: 1c49d26126aee347d8dbe7bb5ad63310
SHA1: bfc32edd8a7d9d77cc2f3494fdd8800218bba13f
SHA256: 6119224929dc0577199c1b32cc3a65b0c3a7c10339fa9f51237e1192dff6c49e
Description-en: AVR development board IDE and built-in libraries
 Arduino is an open-source electronics prototyping platform based on
 flexible, easy-to-use hardware and software. It's intended for artists,
 designers, hobbyists, and anyone interested in creating interactive
 objects or environments.
 .
 This package will install the integrated development environment that
 allows for program writing, code verification, compiling, and uploading
 to the Arduino development board. Libraries and example code will also
 be installed.
Description-md5: 60f8f72e8783c6b5a72254120b680cdb
Homepage: http://www.arduino.cc
Bugs: https://bugs.launchpad.net/ubuntu/+filebug
Origin: Ubuntu
kcb@ubuntu$

Here we see that they’re still offering the incredibly old Version: 1:1.0.5+dfsg2-2, so we’ll move on to step #2.

Step #2

Find the source files for the version that you do want. The current Arduino IDE source files can be found on their homepage. Sidebar: there’s recently been a rift amongst the founders of the Arduino organization. Be sure you’re on the ‘.cc’ domain and not the ‘.org’. Based on your system’s architecture, download the appropriate file (e.g. 32 vs 64 bit).

Step #3

Assuming that you’re already located in your $HOME directory, move the file you just downloaded (probably in ~/Downloads :D) to your $HOME directory and extract it. Don’t forget to ditch the archive after you extract it, you won’t be needing it any more.

Move the archive to your $HOME directory and extract it
1
2
3
4
5
6
7
kcb@ubuntu$ mv ~/Downloads/arduino-1.6.1-linux64.tar.xz .
kcb@ubuntu$ tar -xf arduino-1.6.1-linux64.tar.xz
kcb@ubuntu$ ls -l | grep arduino
-rw-rw-r--  1 kcb kcb 61284080 Mar 10 12:37 arduino-1.6.1-linux64.tar.xz
drwxrwxr-x  8 kcb kcb     4096 Mar 10 12:51 arduino-1.6.1
kcb@ubuntu$ rm arduino-1.6.1-linux64.tar.xz
kcb@ubuntu$

Step #4

If you don’t mind cd-ing into the ~/arduino-1.6.1 directory and running bash arduino every time you want to launch the program, you can stop here. For those of you who are a little more lazy like myself, we’ll next be creating an application launcher. Note: I’m currently using Ubuntu 14.04.1 LTS with Gnome Flashback Metacity. The file locations may differ slightly depending on which distribution/desktop environment you’re using…but you’ll figure it out.

First, create the file /usr/share/applications/arduino.desktop and include the following information therein.

Contents of arduino.desktop file
1
2
3
4
5
6
7
8
9
[Desktop Entry]
Name=Arduino
Comment=Create physical computing projects
Exec=/home/username/arduino-1.6.1/arduino
Icon=/home/username/arduino-1.6.1/lib/arduino_icon.ico
Categories=Development;Engineering;Electronics;
Version=1.0
Type=Application
Terminal=false

Step #5

You’ve got to make your new file executable, so…

Make arduino.desktop executable
1
kcb@ubuntu$ chmod +x arduino.desktop

Step #6

Finally, you just need to check to see if the application launcher file is free from errors.

Check the validity of your new application launcher file
1
2
kcb@ubuntu$ desktop-file-validate /usr/share/applications/arduino.desktop
kcb@ubuntu$

If no errors are returned and you get back a ready command-prompt, you’re in business.

Done!

That’s it. You should now be able to browse to Applications/Programming/Arduino from the panel up top and the Arduino IDE should fire right up. No longer are you bound to the crusty old releases in the Ubuntu Software Center!

Comments