Install Arduino on (older) Ubuntu Linux versions

Table of Contents

  • Ubuntu 6.06
  • Bug on Ubuntu 7.04 and 7.10 : Arduino is not detected
  • Bug on Ubuntu 64 bits edition of 7.10 : Wrong librxtxSerial.so
  • Bug on Ubuntu 7.04 : Keyboard shortcuts not working
  • Problems Ubuntu 8.04 amd64 : Wrong librxtxSerial.so
  • Problems Ubuntu 8.04 386
  • Problems Ubuntu 8.10 (Intrepid): Buggy version of avr-gcc
  • Problems with avrdude and Duemilanove's atmega328
  • Ubuntu 9.04 64-Bit
  • Linux Mint 7 (customised Ubuntu 9.04 LiveCD)

Ubuntu 6.06

These instructions were tested on Ubuntu 6.06 (Dapper Drake) but similar steps should work on other versions. (You will find one step written up for both Dapper and 7.04)

  1. Run Synaptic Package Manager (in "System > Administration").
  2. First you need to enable the "Universe" and "Multiverse" repositories so you can access all the packages you need.
    • -- For Dapper...
    • Go to "Settings ; Repositories".
    • Click "Add".
    • Check "Community maintained (Universe)" and "Non-free (Multiverse)" and click "Add".
    • Click "Close"; click "Close" on the "repostories changed" dialog.
    • -- For Ubuntu 7.04...
    • Go tp "Settings ; Repositories".
    • Look at the tick box items on the "Ubuntu Software" tab.
    • One enables "Universe", another "Multiverse". You may find one or both already ticked.
    • Click "Close" as needed.
  3. Click the "Reload" button in the toolbar.
  4. Mark for installation: "sun-java5-jre", "gcc-avr", "avr-libc".
  5. Click "Apply" in the toolbar.
  6. Click "Apply" in the dialog. This will install the selected packages.
  7. Accept Java licensing.
  8. Wait for the installation to complete: the dialog will say "Changes applied". Click "close".
  9. Quit Synaptic.
  10. Download the Arduino Linux distribution from the software page. Double click the .zip file and drag the contained folder somewhere (like your Desktop).
  11. Run the Terminal (in Application > Accessories).
  12. Type "sudo update-alternatives --config java" and press enter. Type the number of the option which has "java-1.5.0-sun" in it and press enter. This will make Sun's version of Java the default on your system - necessary because the GNU version doesn't yet support everything needed for the Arduino environment.
  13. Double-click "arduino" in the Arduino application folder. This may bring up a dialog asking you where to store your Arduino sketch files. An "Arduino" directory in your home folder is the typical location. Click "okay". The Arduino environment should open. (If you don't get asked about where you want your sketch files, you can set the default folder for them with File | Preferences.)

A pre-compiled patched version of avrdude is included. If it doesn't run on your system, you'll need to install it yourself. The source is available here: avrdude-5.4-arduino-0010-src.tgz. After compiling, copy avrdude and avrdude.conf to the hardware/tools/ sub-directory of the Arduino application directory.

Bug on Ubuntu 7.04 (Feisty Fawn) and 7.10 (Gutsy Gibbon) : Arduino is not detected

You need to uninstall braille support if you want to use /dev/ttyUSB0: just remove the package brltty in Adept, and the USB port will be available for communication with Arduino.

Two symptoms of this problem are:

  • you will never see /dev/ttyUSB0 as a choice under the Arduino software's Tools -> Serial Port menu
  • if you watch the Rx LED on the Arduino board, you may see it flicker 3 to 5 times (to fast for me to count) every 5 to 6 seconds

Bug on 64 bit edition of 7.10 (Gutsy Gibbon)

if you get an exception like this one:

Exception in thread "main" java.lang.UnsatisfiedLinkError: /home/chris/Desktop/arduino-0011/lib/librxtxSerial.so: /home/chris/Desktop/arduino-0011/lib/librxtxSerial.so: wrong ELF class: ELFCLASS32 (Possible cause: architecture word width mismatch)

download a librxtxSerial.so which fits your architecture:

apt-get install librxtx-java
replace the librxtxSerial.so with the amd64 version from /usr/lib/librxtxSerial.so

Bug on Ubuntu 7.04: Keyboard shortcuts not working

September 23, 2007 , relates to Ubuntu 7.04

The keyboard shortcuts (Ctrl-X Ctrl-V etc.) in the arduino-ide are not working due to a bug in the Java Runtime Environment version 1.6.00.

Since this is the latest version of the JRE that can be installed through Adept, there is no easy workaround. You either have to downgrade to version 1.5 of the Java Runtime (available through Adept) or install an updated version (>=1.6.02) of the runtime manually.

October 15, 2007 Bug has been fixed in Ubuntu 7.10 (Gutsy Gibbon)

Problems Ubuntu 8.04 amd64

if you get an exception like this one:

Exception in thread "main" java.lang.UnsatisfiedLinkError: /home/chris/Desktop/arduino-0011/lib/librxtxSerial.so: /home/chris/Desktop/arduino-0011/lib/librxtxSerial.so: wrong ELF class: ELFCLASS32 (Possible cause: architecture word width mismatch)

download a librxtxSerial.so which fits your architecture:

apt-get install librxtx-java
replace the librxtxSerial.so with the amd64 version from /usr/lib/librxtxSerial.so

If your program wont compile for atmega 328 then your gcc-avr is probably version 4.4.2

Check by issuing the command: avr-gcc -v

If it returns 4.2.2, add the following repository to Synaptic package manager:

deb http://cz.archive.ubuntu.com/ubuntu jaunty main universe

(Yes these are packages from the Ubuntu version Jaunty (9.04), but they are not dependent on other packages, so it should not break Ubuntu 8.04)

Then update both gcc-avr and avr-libc .

I suggest you then disable the above repository, so as not to break your system by mistake!

Problems Ubuntu 8.04 386

An exception like:

java.lang.ClassNotFoundException: com.sun.java.swing.plaf.gtk.GTKLookAndFeel not found in
gnu.gcj.runtime.SystemClassLoader{urls=[file:lib/,
file:lib/build/,file:lib/pde.jar,file:lib/antlr.jar,file:lib/oro.jar,
file:lib/registry.jar,file:lib/mrj.jar,file:lib/RXTXcomm.jar],
parent=gnu.gcj.runtime.ExtensionClassLoader{urls=[], parent=null}}
   at java.net.URLClassLoader.findClass(libgcj.so.81)
   at gnu.gcj.runtime.SystemClassLoader.findClass(libgcj.so.81)
   at java.lang.ClassLoader.loadClass(libgcj.so.81)
   at java.lang.ClassLoader.loadClass(libgcj.so.81)
   at java.lang.Class.forName(libgcj.so.81)
   at javax.swing.UIManager.setLookAndFeel(libgcj.so.81)
   at processing.app.Base.<init>(Base.java:131)
   at processing.app.Base.main(Base.java:104)

Means gcj is not working right for you. Try uninstalling it and its dependencies but keep your jre installed.

Problems Ubuntu 8.10 (Intrepid)

It looks as though the bug described below has been fixed. Since gcc-avr (1:4.3.0-3), ubuntu 8.10's gcc-avr has been patched to fix gcc-avr bug #35519, which, according to gcc bug #35872, solves this issue, so the steps below are no longer necessary.

Ubuntu 8.10 has by default avr-gcc version 4.3.0, which has a major bug that affects constant multiplication of long int's. You can check your current version using "avr-gcc --version".

If necessary, you can upgrade to the versions of the gcc-avr and avr-libc packages from Ubuntu Jaunty as shown below (should no longer be necessary!):

  1. $sudo vim /etc/apt/sources.list
  2. add the following line: deb http://archive.ubuntu.com/ubuntu jaunty main restricted universe multiverse
  3. $sudo apt-get update
  4. Then update gcc-avr and avr-libc from Synaptic Package Manager
  5. remove comment the line added to sources.list by adding a leading #
  6. $sudo apt-get update

Ubuntu 9.04 (Jaunty)

Ubuntu 9.0.4 installs fine but does not run in the Ubuntu Netbook Remix(UNR) version. In UNR the Arduino IDE starts, but the main window stays blank. One workaround is to right click on the window title bar and choose Unmaximize, then resize the windows as large as you want, but don't maximize it. After Unmaximizing the window may appear really small (1cm x 1cm) in the upper left cornet, just drag the borders with the mouse to make it bigger.

Duemilanove's atmega328: avrdude error

If you're getting an error like "avrdude: AVR Part "m328p" not found" while trying to upload a sketch to your Duemilanove, that's because the avrdude version shipped with Jaunty is outdated; you'll need to compile it yourself, version 5.6 or higher, available here

Ubuntu 9.04 (Jaunty), 64-Bit

  1. Install these packages through Synaptic:
    • librxtx-java (this will bring in the rest of the java development environment that you need as well)
    • gcc-avr
    • binutils-avr
    • avr-libc
    • avrdude
  2. In the Arduino folder, open the "lib" folder
  3. Look for librxtxSerial.so, and either delete it, move it to another location, or just rename it. Getting rid of this should make Arduino load the correct 64 bit version of librxtx-java instead.

If you're having trouble with "Exception in thread "main" java.lang.NoClassDefFoundError: gnu/io/CommPortIdentifier", another solution is to replace the librxtxSerial.so and RXTXComm.jar from the "lib" folder and replace them with the files from libRXTX's 2.2 pre-release branch. More details are available.

Linux Mint 7 on LiveCD or Harddrive (Ubuntu 9.04 Jaunty)

Linux Mint is a lightly customised version of Ubuntu, with things like Flash and DVDCSS and other things included by default. These instructions may therefore also work for Ubuntu Jaunty.

To run it on any Intel machine (even one with Windows installed) you can boot from a LiveCD available at http://www.linuxmint.com/

'WARNING when using a LiveCD anything you save is in a temporary filesystem. Save to a pen drive or somewhere else to be sure of keeping your files.

The following sequence of instructions completely installed and launched the arduino 17 environment from a Linux Mint 7 LiveCD. They also work on a fully installed version of Linux Mint 7.

The arduino-0017 folder should show up in your home folder and it should automatically launch arduino. All you then have to do is choose the correct serial port and board type in the menus and you can program arduino.

 #!/bin/bash
 sudo apt-get install avr-libc
 cd ~/
 wget http://arduino.googlecode.com/files/arduino-0017.tgz
 tar xzvf arduino*.tgz
 cd `find -type d -name 'arduino*'`
 ./arduino

You may wish to boot in compatibility mode, or edit the boot options to disable ACPI if it doesn't boot on any particular machine, although this is rare. To modify the boot options to achieve this you add...

 acpi=off pci=noacpi

Share