Chrooting returns exec format error的合理解释

Knowledge Base:Chrooting returns exec format error

Contents

 [hide] 
  • 1 Synopsis
  • 2 Environment
  • 3 Analysis
  • 4 Resolution

Synopsis

During the installation of Gentoo Linux, attempting to chroot into the new environment breaks with the following error:

root # chroot /mnt/gentoo /bin/bash
chroot: failed to run command `/bin/bash': Exec format error

Environment

This article applies to Gentoo Linux installations on an x86_64 platform (amd64 architecture).

Analysis

The error Exec format error means that the binary being executed is made for a different architecture than the environment currently booted. It usually occurs when the system has been booted on a 32-bit system when a 64-bit environment is trying to load.

Resolution

Reboot the live environment and choose the correct architecture (most LiveCDs support a 64-bit kernel as well as a 32-bit option, although it is not booted by default). Look for entries labeled gentoo64 or linux64 if trying to boot a 64-bit system.

https://wiki.gentoo.org/wiki/Knowledge_Base:Chrooting_returns_exec_format_error


原因就是架构不同,32位与64位架构差别 或者arm与x86架构差别

你可能感兴趣的:(Chrooting returns exec format error的合理解释)