avr-g++: error on Linux Mint 18

Hello,

Did somebody install Arduino IDE on Linux Mint 18 XFCE distro (I've got that error also on 17...)?

On a fresh LinuxMint 18 computer (32bit XFCE distro), I try to install Arduino IDE 1.8.3 (I struggle since 1.8.1) by using the downloaded package offered by the Arduino IDE's site.

The installation was not a problem... The installation was successfull... The Arduino's icon shows on desktop... Even in the "start menu", under the "Development" I found the Arduino IDE's icon.

The problem is whatever sketch I try to compile, I obtain the following error code:
"avr-g++: error trying to exec '/opt/arduino-1.8.3/hardware/tools/avr/bin/../lib/gcc/avr/4.9.2/../../../../avr/bin/as': execv: Exec format error"

Even I try to compile that empty sketch offered by the IDE itself, when the Arduino starts, I've got that error!
(for the moment I am forced to switch to a virtual Windows machine to use Arduino 1.8.3 over there...)

What should I do to have a fully functional Arduino 1.8.3 on my XFCE LinuxMint 18?
Somebody could help?!

I'll appreciate a lot!
Thank you in advance!

I just loaded 1.8.3 on a new install of Linux Mint 18.1 (64 bit XFCE)

Downloaded Arduino 1.8.3.

Extracted in /home/kprims/Downloads/

Blink sketch

/home/kprims/Downloads/arduino-1.8.3/arduino-builder -dump-prefs -logger=machine -hardware /home/kprims/Downloads/arduino-1.8.3/hardware -hardware /home/kprims/.arduino15/packages -tools /home/kprims/Downloads/arduino-1.8.3/tools-builder -tools /home/kprims/Downloads/arduino-1.8.3/hardware/tools/avr -tools /home/kprims/.arduino15/packages -built-in-libraries /home/kprims/Downloads/arduino-1.8.3/libraries -libraries /home/kprims/Arduino/libraries -fqbn=arduino:avr:uno -ide-version=10803 -build-path /tmp/arduino_build_720241 -warnings=none -build-cache /tmp/arduino_cache_828605 -prefs=build.warn_data_percentage=75 -prefs=runtime.tools.avrdude.path=/home/kprims/Downloads/arduino-1.8.3/hardware/tools/avr -prefs=runtime.tools.avr-gcc.path=/home/kprims/Downloads/arduino-1.8.3/hardware/tools/avr -prefs=runtime.tools.arduinoOTA.path=/home/kprims/Downloads/arduino-1.8.3/hardware/tools/avr -verbose /home/kprims/Downloads/arduino-1.8.3/examples/01.Basics/Blink/Blink.ino
/home/kprims/Downloads/arduino-1.8.3/arduino-builder -compile -logger=machine -hardware /home/kprims/Downloads/arduino-1.8.3/hardware -hardware /home/kprims/.arduino15/packages -tools /home/kprims/Downloads/arduino-1.8.3/tools-builder -tools /home/kprims/Downloads/arduino-1.8.3/hardware/tools/avr -tools /home/kprims/.arduino15/packages -built-in-libraries /home/kprims/Downloads/arduino-1.8.3/libraries -libraries /home/kprims/Arduino/libraries -fqbn=arduino:avr:uno -ide-version=10803 -build-path /tmp/arduino_build_720241 -warnings=none -build-cache /tmp/arduino_cache_828605 -prefs=build.warn_data_percentage=75 -prefs=runtime.tools.avrdude.path=/home/kprims/Downloads/arduino-1.8.3/hardware/tools/avr -prefs=runtime.tools.avr-gcc.path=/home/kprims/Downloads/arduino-1.8.3/hardware/tools/avr -prefs=runtime.tools.arduinoOTA.path=/home/kprims/Downloads/arduino-1.8.3/hardware/tools/avr -verbose /home/kprims/Downloads/arduino-1.8.3/examples/01.Basics/Blink/Blink.ino
Using board 'uno' from platform in folder: /home/kprims/Downloads/arduino-1.8.3/hardware/arduino/avr
Using core 'arduino' from platform in folder: /home/kprims/Downloads/arduino-1.8.3/hardware/arduino/avr
Detecting libraries used...
"/home/kprims/Downloads/arduino-1.8.3/hardware/tools/avr/bin/avr-g++" -c -g -Os -w -std=gnu++11 -fpermissive -fno-exceptions -ffunction-sections -fdata-sections -fno-threadsafe-statics  -flto -w -x c++ -E -CC -mmcu=atmega328p -DF_CPU=16000000L -DARDUINO=10803 -DARDUINO_AVR_UNO -DARDUINO_ARCH_AVR   "-I/home/kprims/Downloads/arduino-1.8.3/hardware/arduino/avr/cores/arduino" "-I/home/kprims/Downloads/arduino-1.8.3/hardware/arduino/avr/variants/standard" "/tmp/arduino_build_720241/sketch/Blink.ino.cpp" -o "/dev/null"
Generating function prototypes...
"/home/kprims/Downloads/arduino-1.8.3/hardware/tools/avr/bin/avr-g++" -c -g -Os -w -std=gnu++11 -fpermissive -fno-exceptions -ffunction-sections -fdata-sections -fno-threadsafe-statics  -flto -w -x c++ -E -CC -mmcu=atmega328p -DF_CPU=16000000L -DARDUINO=10803 -DARDUINO_AVR_UNO -DARDUINO_ARCH_AVR   "-I/home/kprims/Downloads/arduino-1.8.3/hardware/arduino/avr/cores/arduino" "-I/home/kprims/Downloads/arduino-1.8.3/hardware/arduino/avr/variants/standard" "/tmp/arduino_build_720241/sketch/Blink.ino.cpp" -o "/tmp/arduino_build_720241/preproc/ctags_target_for_gcc_minus_e.cpp"
"/home/kprims/Downloads/arduino-1.8.3/tools-builder/ctags/5.8-arduino11/ctags" -u --language-force=c++ -f - --c++-kinds=svpf --fields=KSTtzns --line-directives "/tmp/arduino_build_720241/preproc/ctags_target_for_gcc_minus_e.cpp"
Compiling sketch...
"/home/kprims/Downloads/arduino-1.8.3/hardware/tools/avr/bin/avr-g++" -c -g -Os -w -std=gnu++11 -fpermissive -fno-exceptions -ffunction-sections -fdata-sections -fno-threadsafe-statics -MMD -flto -mmcu=atmega328p -DF_CPU=16000000L -DARDUINO=10803 -DARDUINO_AVR_UNO -DARDUINO_ARCH_AVR   "-I/home/kprims/Downloads/arduino-1.8.3/hardware/arduino/avr/cores/arduino" "-I/home/kprims/Downloads/arduino-1.8.3/hardware/arduino/avr/variants/standard" "/tmp/arduino_build_720241/sketch/Blink.ino.cpp" -o "/tmp/arduino_build_720241/sketch/Blink.ino.cpp.o"
Compiling libraries...
Compiling core...
Using precompiled core
Linking everything together...
"/home/kprims/Downloads/arduino-1.8.3/hardware/tools/avr/bin/avr-gcc" -w -Os -g -flto -fuse-linker-plugin -Wl,--gc-sections -mmcu=atmega328p  -o "/tmp/arduino_build_720241/Blink.ino.elf" "/tmp/arduino_build_720241/sketch/Blink.ino.cpp.o" "/tmp/arduino_build_720241/../arduino_cache_828605/core/core_arduino_avr_uno_debaf4f54fbc31c42191d59a032a3d64.a" "-L/tmp/arduino_build_720241" -lm
"/home/kprims/Downloads/arduino-1.8.3/hardware/tools/avr/bin/avr-objcopy" -O ihex -j .eeprom --set-section-flags=.eeprom=alloc,load --no-change-warnings --change-section-lma .eeprom=0  "/tmp/arduino_build_720241/Blink.ino.elf" "/tmp/arduino_build_720241/Blink.ino.eep"
"/home/kprims/Downloads/arduino-1.8.3/hardware/tools/avr/bin/avr-objcopy" -O ihex -R .eeprom  "/tmp/arduino_build_720241/Blink.ino.elf" "/tmp/arduino_build_720241/Blink.ino.hex"
Sketch uses 928 bytes (2%) of program storage space. Maximum is 32256 bytes.
Global variables use 9 bytes (0%) of dynamic memory, leaving 2039 bytes for local variables. Maximum is 2048 bytes.

I guess you are lucky, otherwise I could not explain... The same error I've got also on a Linux Mint machine (with Mint XFCE 17.3). Maybe you try it on other Mint distribution than XFCE!?

Far as I know, for example, on MATE and CINNAMON distro works... But I am not interested on those...
I run Mint XFCE distro... Maybe that's why works on you...

Thanks anyway for your reply!

"I guess you are lucky, otherwise I could not explain... The same error I've got also on a Linux Mint machine (with Mint XFCE 17.3). Maybe you try it on other Mint distribution than XFCE!?"

Lucky isn't something I've been called in quite some time. :slight_smile: If something can be installed backwards, I'm your man. :slight_smile:

$ cat /etc/linuxmint/info
RELEASE=18.1
CODENAME=serena
EDITION="Xfce 64-bit"
DESCRIPTION="Linux Mint 18.1 Serena"
DESKTOP=Xfce
TOOLKIT=GTK
NEW_FEATURES_URL=http://www.linuxmint.com/rel_serena_xfce_whatsnew.php
RELEASE_NOTES_URL=http://www.linuxmint.com/rel_serena_xfce.php
USER_GUIDE_URL=help:linuxmint
GRUB_TITLE=Linux Mint 18.1 Xfce 64-bit

Works so far.

This is just a guess, but maybe check "/home/"user"/.ardunio15/packages

This is what mine looks like, notice that there is no arduino folder.

~/.arduino15/packages $ ls
ATTinyCore MegaCore MightyCore MiniCore

"Far as I know, for example, on MATE and CINNAMON distro works... But I am not interested on those...
I run Mint XFCE distro... Maybe that's why works on you..."

cat /etc/linuxmint/info
RELEASE=18.1
CODENAME=serena
EDITION="MATE 64-bit"
DESCRIPTION="Linux Mint 18.1 Serena"
DESKTOP=MATE
TOOLKIT=GTK
NEW_FEATURES_URL=http://www.linuxmint.com/rel_serena_mate_whatsnew.php
RELEASE_NOTES_URL=http://www.linuxmint.com/rel_serena_mate.php
USER_GUIDE_URL=help:linuxmint
GRUB_TITLE=Linux Mint 18.1 MATE 64-bit

This works also.

@kprims: First, I want to thank you for your reply... Maybe I do something wrong, because whatever I do, on my computer does not work... I want to describe my steps, maybe you could see what's wrong...

    • download "arduino-1.8.3-linux32.tar.xz" package in "~/Downloads" and extract it over there; as a result, in Downloads, I have a directory called "arduino-1.8.3"
    • cd ~\Downloads\arduino-1.8.3
    • sudo ./install.sh
      (at the end, it says: "Adding desktop shortcut, menu item and file associations for Arduino IDE... done!"

Now, start Arduino IDE from WhiskerMenu, "START->Development->Arduino IDE" icon. It opens with a blank sketch. Ignore it and load instead the "Blink" sketch (see attached picture) and try to build...

:o ...the same error as I said... (marked on the picture)

What's wrong?! Maybe you understand something, because all I do was "classic"!...

cat-info command gives me the following:

dragos@vbx-lm180 ~ $ cat /etc/linuxmint/info
RELEASE=18
CODENAME=sarah
EDITION="Xfce 32-bit"
DESCRIPTION="Linux Mint 18 Sarah"
DESKTOP=Xfce
TOOLKIT=GTK
NEW_FEATURES_URL=http://www.linuxmint.com/rel_sarah_xfce_whatsnew.php
RELEASE_NOTES_URL=http://www.linuxmint.com/rel_sarah_xfce.php
USER_GUIDE_URL=help:linuxmint
GRUB_TITLE=Linux Mint 18 Xfce 32-bit
dragos@vbx-lm180 ~ $

...and the ".arduino15" directory is not like yours: mine contains the following files (only!)

dragos@vbx-lm180 ~ $ ls ~/.arduino15
library_index.json package_index.json package_index.json.sig preferences.txt
dragos@vbx-lm180 ~ $

No DIRs! No "~/.arduino15/packages" folder.

It's something that I've done wrong?!
Again, thank you in advance for your effort in helping me to start the Arduino IDE on my LinuxMint18, XFCE distro!

Have a nice day!

:o Just right now, I observe that my Linux Mint 18 it's a 32-bit distro! Could be that?! Arduino IDE don't works on a 32-bit distro? It's hard to believe... Anyway, I download the 32-bit package: "arduino-1.8.3-linux32.tar.xz"
So?!

"3. - sudo ./install.sh
(at the end, it says: "Adding desktop shortcut, menu item and file associations for Arduino IDE... done!""

Try this without "sudo".

I always install Arduino as a "user" not as "root".

Sorry to say, but I've got the same error message!
Anyway, the "~/.arduino15/packages" folder does not exist and I wonder why?!

Maybe I should try to install Arduino IDE on a fresh Linux Mint 18 installation. Perhaps, with all this install/uninstall tryings, something remains on the system which bother further attempts.

Till then, I still have a functional Arduino IDE, but on a VMware machine with Win10. So, I have the backup.
I am not happy with that, but for the moment, I can manage my rover project...
Thank you again for your support!
:slight_smile: