Ошибка формата выполняемого файла ubuntu

I’m trying to run a program, but it gives an error:

bash: ./program: cannot execute binary file: Exec format error

The result of file program was:

program: ELF-32-bit LSB executable, ARM, EABI4 version 1 (SYSV), dynamically linked (uses share libs), for GNU/LINUX 2.6.16, not stripped

How can I fix this?

I’m using Ubuntu 14.04.2 (amd64) with VMware. I also tried using Ubuntu i386, but the result was the same.

Bas van Paassen's user avatar

asked Jul 15, 2015 at 5:30

Soongeun Hwang's user avatar

Soongeun HwangSoongeun Hwang

1,5012 gold badges9 silver badges4 bronze badges

1

You’re trying to run an executable compiled for an ARM architecture on an x86-64 architecture, which is much like asking your processor who only speaks English to take directions in Chinese.

If you need to run that executable you have two choices:

  1. Get an x86-64 version of the executable (by any mean; if you’re unable to get an x86-64 version of the executable but you’re able to get its source code, you can try to recompile it on the virtual machine);

  2. Install Ubuntu Server for ARM in place of Ubuntu 14.04.2 (amd64). This requires either a physical machine running on an ARM architecture or a virtualization software that can emulate it.

answered Jul 15, 2015 at 5:39

kos's user avatar

1

This can also occur if you attempt to run an x86-64 executable on a 32-bit platform.

In one specific instance, I downloaded Visual Studio Code and tried to run it on my Ubuntu installation, but I hadn’t realized that I had installed 32-bit Ubuntu in this VM. I got this error, but after downloading the 32-bit version, it ran without issue.

answered Sep 10, 2015 at 23:44

Hughie Coles's user avatar

It is often possible to run an ARM executable image on an amd64 system if you install the binfmt-support, qemu, and qemu-user-static packages:

sudo apt install binfmt-support qemu qemu-user-static

qemu will then perform syscall emulation when you run the executable. This works for most ARM binaries but there are a few that may not run correctly.

ArrayBolt3's user avatar

answered Oct 27, 2016 at 6:41

Nathan Osman's user avatar

Nathan OsmanNathan Osman

31.9k40 gold badges177 silver badges259 bronze badges

2

Such error may occur if all of the following are true:

  • Executable is not a file but a link
  • You run run it inside VM
  • File is located in shared folder
  • Your host is Windows.

If you got that file, let’s say, in archive — try to unpack it inside VM, in some directory inside virtual drive, not folder mapped to your host machine hard drive, for example /myNewDir/

wjandrea's user avatar

wjandrea

14k4 gold badges46 silver badges98 bronze badges

answered Nov 13, 2015 at 22:22

Pavel's user avatar

PavelPavel

3631 gold badge3 silver badges10 bronze badges

1

If more than one java is installed on the system this might happen and not set as default. On Ubuntu14.04 LTS I could get it resolved by executing following and choosing the java I needed.

sudo update-alternatives --config java
[sudo] password for user: 
update-alternatives: warning: /etc/alternatives/java has been changed (manually or by a script); switching to manual updates only
There are 2 choices for the alternative java (providing /usr/bin/java).

  Selection    Path                                            Priority   Status
------------------------------------------------------------
  0            /usr/lib/jvm/java-7-openjdk-amd64/jre/bin/java   1071      auto mode
  1            /usr/lib/jvm/java-7-openjdk-amd64/jre/bin/java   1071      manual mode
  2            /usr/lib/jvm/java-8-openjdk-amd64/jre/bin/java   1069      manual mode

Press enter to keep the current choice[*], or type selection number: 2
update-alternatives: using /usr/lib/jvm/java-8-openjdk-amd64/jre/bin/java to provide /usr/bin/java (java) in manual mode

I choose 2 and set openjdk-8 as a default. Which did not show the Exec format error.

Videonauth's user avatar

Videonauth

32.9k16 gold badges104 silver badges119 bronze badges

answered Jun 6, 2016 at 13:43

lambzee's user avatar

You must compile your file using an appropriate CPU architecture (x86 for example) and copy the .exe file on your linux machine. Then you can install mono on your linux machine and issue the following command:

mono myprogram.exe

muru's user avatar

muru

192k52 gold badges468 silver badges719 bronze badges

answered Feb 28, 2016 at 19:49

user3578181's user avatar

1

This can also happen if the binary uses a libc implementation which is not libc, such as musl. These days this specific problem is most likely encountered when trying to run a binary with libc in a Docker container with an image based on alpine. There is nothing that can be done to the binary itself to support both environments, because the libc implementation must always be linked statically, i.e. built directly into the binary, for reasons.

answered Jul 16, 2019 at 16:44

Zyl's user avatar

I got this error trying to run a zip file containing an executable rather than extracting it and running the executable itself xD

In addition to the other answers offered here, I suppose there would be a lot of file types that aren’t intended to be executable which could cause this error.

answered May 19, 2020 at 6:05

Alexander Taylor's user avatar

1

This is another special case: WSL (Windows Subsystem for Linux) by default(!) only supports 64bit executables. I think this is a rather unusual behaviour, as normally there is a backwards compatibility.

(Even more special is that selecting 64bit in a formerly 32bit project of Windev won’t fix your issue. You need to start a new project, selecting 64bit right in the beginning. Tested on Windev 26. This IDE sucks, forced to use it because of working legacy code.)

answered Jul 21, 2022 at 23:23

PythoNic's user avatar

PythoNicPythoNic

6661 gold badge5 silver badges15 bronze badges

2

I’m trying to run a program, but it gives an error:

bash: ./program: cannot execute binary file: Exec format error

The result of file program was:

program: ELF-32-bit LSB executable, ARM, EABI4 version 1 (SYSV), dynamically linked (uses share libs), for GNU/LINUX 2.6.16, not stripped

How can I fix this?

I’m using Ubuntu 14.04.2 (amd64) with VMware. I also tried using Ubuntu i386, but the result was the same.

Bas van Paassen's user avatar

asked Jul 15, 2015 at 5:30

Soongeun Hwang's user avatar

Soongeun HwangSoongeun Hwang

1,5012 gold badges9 silver badges4 bronze badges

1

You’re trying to run an executable compiled for an ARM architecture on an x86-64 architecture, which is much like asking your processor who only speaks English to take directions in Chinese.

If you need to run that executable you have two choices:

  1. Get an x86-64 version of the executable (by any mean; if you’re unable to get an x86-64 version of the executable but you’re able to get its source code, you can try to recompile it on the virtual machine);

  2. Install Ubuntu Server for ARM in place of Ubuntu 14.04.2 (amd64). This requires either a physical machine running on an ARM architecture or a virtualization software that can emulate it.

answered Jul 15, 2015 at 5:39

kos's user avatar

1

This can also occur if you attempt to run an x86-64 executable on a 32-bit platform.

In one specific instance, I downloaded Visual Studio Code and tried to run it on my Ubuntu installation, but I hadn’t realized that I had installed 32-bit Ubuntu in this VM. I got this error, but after downloading the 32-bit version, it ran without issue.

answered Sep 10, 2015 at 23:44

Hughie Coles's user avatar

It is often possible to run an ARM executable image on an amd64 system if you install the binfmt-support, qemu, and qemu-user-static packages:

sudo apt install binfmt-support qemu qemu-user-static

qemu will then perform syscall emulation when you run the executable. This works for most ARM binaries but there are a few that may not run correctly.

ArrayBolt3's user avatar

answered Oct 27, 2016 at 6:41

Nathan Osman's user avatar

Nathan OsmanNathan Osman

31.9k40 gold badges177 silver badges259 bronze badges

2

Such error may occur if all of the following are true:

  • Executable is not a file but a link
  • You run run it inside VM
  • File is located in shared folder
  • Your host is Windows.

If you got that file, let’s say, in archive — try to unpack it inside VM, in some directory inside virtual drive, not folder mapped to your host machine hard drive, for example /myNewDir/

wjandrea's user avatar

wjandrea

14k4 gold badges46 silver badges98 bronze badges

answered Nov 13, 2015 at 22:22

Pavel's user avatar

PavelPavel

3631 gold badge3 silver badges10 bronze badges

1

If more than one java is installed on the system this might happen and not set as default. On Ubuntu14.04 LTS I could get it resolved by executing following and choosing the java I needed.

sudo update-alternatives --config java
[sudo] password for user: 
update-alternatives: warning: /etc/alternatives/java has been changed (manually or by a script); switching to manual updates only
There are 2 choices for the alternative java (providing /usr/bin/java).

  Selection    Path                                            Priority   Status
------------------------------------------------------------
  0            /usr/lib/jvm/java-7-openjdk-amd64/jre/bin/java   1071      auto mode
  1            /usr/lib/jvm/java-7-openjdk-amd64/jre/bin/java   1071      manual mode
  2            /usr/lib/jvm/java-8-openjdk-amd64/jre/bin/java   1069      manual mode

Press enter to keep the current choice[*], or type selection number: 2
update-alternatives: using /usr/lib/jvm/java-8-openjdk-amd64/jre/bin/java to provide /usr/bin/java (java) in manual mode

I choose 2 and set openjdk-8 as a default. Which did not show the Exec format error.

Videonauth's user avatar

Videonauth

32.9k16 gold badges104 silver badges119 bronze badges

answered Jun 6, 2016 at 13:43

lambzee's user avatar

You must compile your file using an appropriate CPU architecture (x86 for example) and copy the .exe file on your linux machine. Then you can install mono on your linux machine and issue the following command:

mono myprogram.exe

muru's user avatar

muru

192k52 gold badges468 silver badges719 bronze badges

answered Feb 28, 2016 at 19:49

user3578181's user avatar

1

This can also happen if the binary uses a libc implementation which is not libc, such as musl. These days this specific problem is most likely encountered when trying to run a binary with libc in a Docker container with an image based on alpine. There is nothing that can be done to the binary itself to support both environments, because the libc implementation must always be linked statically, i.e. built directly into the binary, for reasons.

answered Jul 16, 2019 at 16:44

Zyl's user avatar

I got this error trying to run a zip file containing an executable rather than extracting it and running the executable itself xD

In addition to the other answers offered here, I suppose there would be a lot of file types that aren’t intended to be executable which could cause this error.

answered May 19, 2020 at 6:05

Alexander Taylor's user avatar

1

This is another special case: WSL (Windows Subsystem for Linux) by default(!) only supports 64bit executables. I think this is a rather unusual behaviour, as normally there is a backwards compatibility.

(Even more special is that selecting 64bit in a formerly 32bit project of Windev won’t fix your issue. You need to start a new project, selecting 64bit right in the beginning. Tested on Windev 26. This IDE sucks, forced to use it because of working legacy code.)

answered Jul 21, 2022 at 23:23

PythoNic's user avatar

PythoNicPythoNic

6661 gold badge5 silver badges15 bronze badges

2

Перейти к содержимому

Ситуация

При запуске программы через меню приложений возникает эта ошибка, программа не запускается.

Я встречал это на Oracle SQLDeveloper любой версии 20+, который устанавливался из официального rpm в среде Ubuntu + KDE с помощью sudo alien -dic. Ошибки не было в MATE. Может не встречаться в GNOME. Встретил только в KDE.

Ошибки нет, если запустить программу напрямую из терминала.

Ошибки нет, если запустить desktop-файл через gio launch.

Выдача прав a+x на desktop-файлы не помогает.

Запуск через kioclient5 exec прерывается ошибкой:

Неизвестная ошибка 100
execvp: Ошибка формата выполняемого файла
Отправьте сообщение об ошибке на https://bugs.kde.org

Проблема

Команда в desktop-файле:

[Desktop Entry]
...
Exec=sqldeveloper
...

Проверяем в терминале:

$ which sqldeveloper
/usr/local/bin/sqldeveloper

$ file "$(which sqldeveloper)"
/usr/local/bin/sqldeveloper: ASCII text

$ head -2 "$(which sqldeveloper)"
/opt/sqldeveloper/sqldeveloper.sh

$ cat /opt/sqldeveloper/sqldeveloper.sh
#!/bin/bash
cd "`dirname $0`"/sqldeveloper/bin && bash sqldeveloper $*

Вывод простой: штатный desktop-файл ссылается на шелл-скрипт без шибенга, который запускает шелл-скрипт с шибенгом. Проблема именно в первом.

Решение

  1. Изменить параметр Exec в desktop-файле на корректный скрипт или бинарник.
  2. Добавить шибенг в первый шелл-скрипт, тогда результат должен быть таким:
$ file "$(which sqldeveloper)"
/usr/local/bin/sqldeveloper: Bourne-Again shell script, ASCII text executable

Предполагаю, что аналогичное решение подойдёт для другого ПО. По крайней мере, стоит попробовать.

You have a 64-bit x86 CPU (indicated by the lm flag in /proc/cpuinfo), but you’re running a 32-bit kernel. The program you’re trying to run requires a 64-bit runtime, so it won’t work as-is: even on a 64-bit CPU, a 32-bit kernel can’t run 64-bit programs.

If you can find a 32-bit build of the program (or build it yourself), use that.

Alternatively, you can install a 64-bit kernel, reboot, and then install the 64-bit libraries required by your program.

To install a 64-bit kernel, run

sudo dpkg --add-architecture amd64
sudo apt-get update
sudo apt-get install linux-image-generic:amd64

This will install the latest 64-bit Xenial kernel, along with various supporting 64-bit packages. Once you reboot, you should find that uname -a shows x86_64 rather than i686. If you attempt to run your program again, it might just work, or you’ll get an error because of missing libraries; in the latter case, install the corresponding packages (use apt-file to find them) to get the program working.

В операционной системе Linux при запуске скаченного файла, либо при запуске самостоятельно скомпилированного файла вы можете столкнуться с ошибкой: 


bash: /путь/до/файла: не удаётся запустить бинарный файл: Ошибка формата выполняемого файла

 

 Если у вас англоязычная локаль, то ошибка будет примерно такой:

 bash: ./program: cannot execute binary file: Exec format error

 В самой ошибке вместо /путь/до/файла и ./program будет указан путь до файла программы, который вы хотите запустить.

  •  Причинами данной ошибки могут быть:
  • попытка запустить 64-битный файл на 32-битной системе
  • файл скомпилирован для другой архитектуры (например, для ARM, а вы пытаетесь запустить его на ПК)
  • вы пытаетесь выполнить не исполнимый файл, а ссылку
  • файл размещён в совместной (shared) папке

Чтобы получить информацию о файле, который вы пытаетесь запустить, можно использовать утилиту file, после которой укажите путь до файла:

 file /путь/до/программы

 Пример вывода: 


program: ELF 64-bit LSB executable, x86-64, version 1 (SYSV), dynamically linked, interpreter /lib64/ld-linux-x86-64.so.2, for GNU/Linux 3.2.0, BuildID[sha1]=03ada11d91d298913990bfc074ccc3a380d26b69, with debug_info, not stripped

 Здесь мы видим, что файл предназначен для 64-битной системы, об этом говорит запись 64-bit, для процессора с архитектурой x86-64.

 Ещё один пример: 


program: ELF-32-bit LSB executable, ARM, EABI4 version 1 (SYSV), dynamically linked(uses share libs), for GNU/LINUX 2.6.16, not stripped

 Этот файл для 32-битных систем, для процессора с архитектурой ARM EABI4.

Если вы не знаете, какой битности ваша система, то выполните команду: 


uname -m

 Для 64-битных систем будет выведено x86_64, а для 32-битных – x86

О разрядности дистрибутивов Linux и о программ 

На компьютер с 32-битным процессором вы можете установить только 32-битную операционную систему и в ней запускать только 32-битные программы.

На компьютер с 64-битным процессором вы можете установить как 64-битную ОС, так и 32-битный Linux. В случае, если вы установили 64-битный дистрибутив Linux, то в нём вы можете запускать и 64-битные программы и 32-битные. А если вы установили 32-битный дистрибутив, то в нём возможно запускать только 32-битные программы.

Итак, если у вас 32-битная система, а файл для 64-битной системы или даже для ARM архитектуры, то у вас следующие варианты:

  • скачать файл подходящей для вас битности и архитектуры
  • если вы самостоятельно компилировали файл из исходного кода, то заново скомпилируйте для процессора вашей архитектуры

Запуск ARM файлов в Linux 

Часто можно запустить исполнимые образы ARM на amd64 системах если установить пакеты binfmt-support, qemu, и qemu-user-static:

 sudo apt install binfmt-support qemu qemu-user-static

Заключение

Итак, ошибка формата выполняемого файла с невозможностью запустить бинарный файл возникает из-за несоответствия программы операционной системе или архитектуре процессора. Эта проблема не должна возникать, если вы установили программу из исходных репозиториев (кроме случаев неправильной настройки источников репозитория). При возникновении этой проблемы поищите файл, подходящий для вашей архитектуры или скомпилируйте файл из исходных кодов под архитектуру вашей операционной системы.

Понравиласть статья? Жми лайк или расскажи своим друзьям!

Похожие новости:

Linux (видео уроки) Обзор Linux видео уроки 1. Введение в ОС Linux/Unix Ubuntu. Видео linux уроки 2017 года. gnu linux operating system. Linux администрирование и linux уроки, linux скачать. To linux distros for 2017 and обзор linux mint 18 1.

Linux mint 19.1 (скачать) Развиваемый сообществом дистрибутив Linux mint, основанный на Ubuntu и Debian, который ставит целью предоставить пользователю «современную, элегантную и удобную операционную систему, которая одновременно является мощной и

Стала доступна для скачивания финальная версия Linux Mint 19 сразу со всеми основными вариантами рабочих столов: Cinnamon, MATE и Xfce. Если вы только начинаете знакомиться с удивительным миром Linux, то поясню: Cinnamon – это самый передовой и

Rosa Linux — Linux из России. ROSA Fresh. Сделана для дома. Создана для вас. ROSA Fresh — это современная отечественная операционная система Linux, создаваемая сообществом и легально доступная всем желающим совершенно бесплатно и без регистрации.

Иногда программа не запускается из-за отсутствия библиотеки определённой версии, при этом в системе может присутствовать эта самая библиотека, но другой версии. Чтобы было понятно, после одного из обновлений (в Arch Linux) перестал запускаться

Новая версия Deepin 15 включает в себя новый дизайн Центра Управления и компьютера, он имеет новый размытый и прозрачный стиль, также включены новые взаимодействия для угловой навигации и оконного менеджера наряду с выбором обоев рабочего стола,

Новые возможности в Linux Mint 19.3. Linux Mint 19.3 — это долгосрочный релиз поддержки, который будет поддерживаться до 2023 года. Он поставляется с обновленным программным обеспечением и приносит уточнения и множество новых функций, чтобы сделать

Linux Mint 19 – это релиз с длительной поддержкой до 2023 года. Он поставляется с обновлённым программным обеспечением и приносит усовершенствования и множество новых функций, чтобы сделать ваш рабочий стол более удобным. На момент написания, Linux

Linux Mint 18.1 Serena Cinnamon (Подробный обзор) Подробный обзор Beta версии Linux Mint 18.1 Serena Cinnamon Linux Mint команда объявила о выпуске обновления для 18.x филиала проекта. В новой версии, Linux Mint 18.1, доступен в двух версиях

Linux mint 18.2 Основные новшества Linux Mint 18.2 (MATE, Cinnamon, KDE и Xfce): В состав включены новые версии десктоп-окружений MATE 1.18 и Cinnamon 3.4, оформление и организация работы в которых продолжает развитие идей GNOME 2 — пользователю

Какой линукс выбрать? Какой linux лучше? Сегодня мы разберемся какие дистрибутивы линукс бывают и какой из них самый лучший. Первое что нужно понять: дистрибутивов линуксов очень много, больше 100. Но, как и в любой экосистеме, тут существует

Начало работы с btrfs для Linux. Файловая система B-tree — это файловая система и менеджер томов, объединенные в одно целое. Он предлагает много перспектив для доставки расширенного набора функций файловой системы в Linux.

Команда с гордостью объявляет о выпуске Linux Mint 20” Ulyana » Cinnamon Edition. Linux Mint 20-это долгосрочный релиз поддержки, который будет поддерживаться до 2025 года. Он поставляется с обновленным программным обеспечением и приносит

Linux Mint 20.2 Ума (Uma) Скачать. Самая большая новость в этом месяце-предстоящий выпуск Linux Mint 20.2 “Uma”. Мы надеемся, что БЕТА-версия будет готова к середине июня.

Новости Linux Январь 2017. НОВОСТИ LINUX, UBUNTU 2017 ЯНВАРЬ В Telegram появилась возможность удалить отправленное сообщения В мессенджере Telegram появилась возможность удалить отправленное сообщения. И если раньше оно удалялось только с одной

Обзор Solus 3 с рабочим окружением Budgie Этот релиз включает в себя из-из-коробки поддержка, универсальных программных пакетов для Linux. Поддержка снимков снимает давление со стороны поставщиков программного обеспечения для конкретной платформы,

Все три издания Linux Mint 19 (Cinnamon, MATE, Xfce) в настоящее время доступны для публичного тестирования. Официально новую бета версию планируют представить 4 июня 2018 года. Хотя перед началом публичных тестирования уже отловлено и исправлено

Преимущества и проблемы беспилотных летательных аппаратов БПЛА или беспилотный летательный аппарат представляет собой самолет с дистанционным управлением. Он может работать удаленно в режиме реального времени или запрограммирован для автономного

Новая ICQ (Windows, Linux, Mac, Web) Что нового: Mail Group представила обновленный мессенджер ICQ. Новая версия знаменитой «аськи» стала «умной, быстрой, гибкой». Разработчики добавили несколько интересных функций, которые

RFRemix 26 основанный на Fedora 26 (Russian Fedora) Официально объявили о выходе Fedora 26. Это проект по поддержке пользователей и разработчиков открытого ПО в России. Основная цель проекта — обеспечить, чтобы Fedora полностью отвечала

  • Ошибка формата потока 1с у одного пользователя
  • Ошибка формата выполняемого файла linux
  • Ошибка формата потока 1с при открытии внешней обработки
  • Ошибка формата валидация xsd яндекс недвижимость
  • Ошибка формата потока 1с не запускается конфигуратор