elf-arch command not found

In this troubleshooting guide we learn how to fix elf-arch command not found error message

Introduction

When you run more command in linux terminal / console, you get the following error message

elf-arch: command not found

or when using sudo you get the following error message

sudo: elf-arch: command not found

Solutions to elf-arch: command not found

How To Fix elf-arch: command not found in Ubuntu / Debian / Kali Linux / Raspbian

In Ubuntu elf-arch is provided by arch-test package.

arch-test is:

This package lets you enumerate architectures that your kernel can run. The check is for the ability to run machine code and supporting appropriate syscall ABI – you may need to install userland libraries in a chroot, container or via multiarch to actually execute non-static binaries of such architectures.

Also provided is “elf-arch”, a tool to determine the architecture of an ELF binary (program or library).

Architectures detected by this version of arch-test are:

  • amd64, i386, x32
  • mips, mipsel, mips64, mips64el
  • arm, armel, armhf, arm64, arm64ilp32
  • powerpc, ppc64, ppc64el, powerpcspe
  • m68k
  • sh4
  • s390x
  • sparc, sparc64
  • illumos-amd64
  • win32, win64
  • kfreebsd-amd64, kfreebsd-i386
  • alpha
  • hppa
  • ia64
  • riscv64

To fix this problem, we can install more using the command below.

sudo apt-get -y install arch-test

This command might take some time to finish depending on your machine internet connection.

You can also use apt command to install arch-test.

sudo apt -y install arch-test

Or if you have aptitude installed you can use the following command.

sudo aptitude install arch-test

Summary

In this tutorial we learn how to fix elf-arch command not found error in Ubuntu / Debian / Kali Linux or Raspbian distribution.