robotthoughts

Install Arduino IDE on Ubuntu 18.04

I had to get an Arduino IDE up and compiling on a Kubuntu 18.04 install. In order to not forget what I did, I made this little post.

This is not super detailed but it should get the job done.

Grad the 64-bit version of the Arduino IDE (or the 32-bit version if you absolutely need it).

Open a terminal and let’s do a few things.

Uncompress the software (cd to your Downloads directory) using ark:

ark arduino-*-linux64.tar.xz

I moved the resulting folder to /opt so it would not litter up my home directory. You will likely need to use sudo.

sudo mv arduino-*/ /opt/

Since we will be working out of that directory now, let’s move into it.

cd /opt/arduino*/

Again, we will leverage sudo to get this installed. Run the install.sh script.

sudo ./install.sh

Once the script completes you should have a new electronics category in your Applications menu with the Arduino IDE.

Open the IDE and make sure it opens appropriately. You are not ready to compile and upload to your board yet. We have a few more steps.

Open the preferences in the Arduino IDE (File -> Preferences). Here you can modify the interface scale to make sure you easily read the screen and code.

Now close the IDE and let’s make sure you can write out across the USB serial line.

Open a terminal again and let’s look at a few things. First notice that your home directory now has an Arduino directory. Inside that directory is the libraries directory. That is where you put your downloaded arduino libraries if you need to download any. That is outside the scope of this document, but now you know where they go.

You should connect via /dev/ttyUSB0 (or 1 or 2, etc.). To make the Arduino IDE work, we will need to add your user to the dialout group and make sure you can read and write to /dev/ttyUSB0. Here are the commands to do accomplish those tasks.

sudo usermod -a -G dialout $USER

sudo chmod a+rw /dev/ttyUSB0

Now reopen your Arduino IDE and compile a sketch. Yuu should be able to write it to your board.

 

Next Post

Previous Post

12 Comments

  1. Mark March 11, 2019

    Thanks a lot! Out of all the answers I was looking for, yours worked.

    • Rich Thompson March 17, 2019 — Post Author

      Glad it worked. That is why I keep a project blog to help others!

      • Suzhou Li April 3, 2019

        Thank you for the detailed steps. Very useful for me. In my computer with Ubuntu 18.04, after installation I got a message that said:

        “rm: cannot remove ‘/usr/local/bin/arduino’: No such file or directory Removing symlink failed. Hope that’s OK. If not then rerun as root with sudo.”

        Does it mean to remove the old existing symbolic link? This is my first time to install this IDE. There should be no such link at all.

  2. S. Li April 3, 2019

    Very nice and helpful. Thanks a lot. In my computer with Ubuntu 18.04, after installation I got a message that said:

    “rm: cannot remove ‘/usr/local/bin/arduino’: No such file or directory Removing symlink failed. Hope that’s OK. If not then rerun as root with sudo.”

    Does it mean to remove the old symbolic link? This is my first time to install it. There should be no such link.

    • Rich Thompson April 4, 2019 — Post Author

      Run the install script using sudo to fix that.

  3. emm April 6, 2019

    Very helpful congrats. but I have a problem. when I try to launch from menu I cannot, If I type “arduino” in terminal I have this error:
    “/opt/java/bin/java: error while loading shared libraries: libjli.so: cannot open shared object file: No such file or directory”
    Do you might know why happen this?
    thanks in advance

  4. Giorgio April 30, 2019

    After I had to install Ubuntu from scratch, because I corrupted the system by following wrong instructions on how to solve the USB port issue, I tried your simple, but effective, instructions and all worked first time and without problems.

    Thank you very much !

  5. Alan May 1, 2019

    Thank you it worked well.

  6. azhari October 1, 2019

    backbox@backbox:~$ sudo chmod a+rw /dev/ttyUSB0
    chmod: cannot access ‘/dev/ttyUSB0’: No such file or directory

    • Rich Thompson October 1, 2019 — Post Author

      See what ttyUSB devices are available and elevate those privileges. Could be USB1 or USB2 or more.

Leave a Reply to S. Li Cancel reply

© 2019 robotthoughts

Theme by Anders Norén

Bitnami