1

I needed updating my cmake program on Ubuntu 22.04.3 version amd64, but wrongly downloaded the aarch64 version of cmake using this method (https://www.golinuxcloud.com/install-cmake-on-ubuntu/#Method-2_Install_From_Binary_File) to override the existing cmake. Not successful though. Now when I type cmake --version on Terminal, unlike before, it responses: bash: /usr/local/bin/cmake: cannot execute binary file: Exec format error

How to remove cmake from my machine, now?

Franky
  • 163

1 Answers1

2

It seems you downloaded the binary for the wrong platform (you're running Amd64, but downloaded for Arm64 (Aarch64).

You should then first clean up the wrong files: (here assuming version 3.27.7)

sudo rm -rf /opt/cmake-3.27.7-linux-aarch64
sudo rm /usr/local/bin/cmake

And now, you can follow the guide again, this time installing the correct file:

wget https://github.com/Kitware/CMake/releases/download/v3.27.7/cmake-3.27.7-linux-x86_64.sh

And then proceed through the guide...

Artur Meinild
  • 26,018