Ubuntu – How to solve wrong ELF class: ELFCLASS32


I'm trying to install swift on ubunu 18.04.
I tried to install it with the command sudo snap install swift but when i try to start it by typing swift i get the error /snap/swift/5/bin/swift: error while loading shared libraries: libatomic.so.1: wrong ELF class: ELFCLASS32.
What can i do for solve this error?

my arch is x86_64

my uname -m is x86_64

Best Answer

  • It seems that there are problems with this snap, its maintainer forgot to add the libatomic.so.1 with correct bitness and CPU architecture:

    $ snap run --shell swift
    $ ldd /snap/swift/5/bin/swift | grep not
      libatomic.so.1 => not found
    $ cd /snap/swift/current $ find -name libatomic.so*

    The solution would be to use edge channel for this snap:

    snap install swift --edge
  • Related Question