为什么 gcc 给出“无法执行二进制文件:可执行格式错误”?

为什么 gcc 给出“无法执行二进制文件:可执行格式错误”?

我注意到我的 gcc 似乎坏了(我正在使用 Ubuntu 18)

$ gcc --version
-bash: /usr/bin/gcc: cannot execute binary file: Exec format error

我尝试重新安装它...

$ sudo apt-get install --reinstall gcc
Reading package lists... Done
Building dependency tree       
Reading state information... Done
0 upgraded, 0 newly installed, 1 reinstalled, 0 to remove and 249 not upgraded.
Need to get 5184 B of archives.
After this operation, 0 B of additional disk space will be used.
Get:1 http://iad-2.clouds.archive.ubuntu.com/ubuntu bionic-updates/main amd64 gcc amd64 4:7.4.0-1ubuntu2.3 [5184 B]
Fetched 5184 B in 0s (33.8 kB/s)
(Reading database ... 135285 files and directories currently installed.)
Preparing to unpack .../gcc_4%3a7.4.0-1ubuntu2.3_amd64.deb ...
Unpacking gcc (4:7.4.0-1ubuntu2.3) over (4:7.4.0-1ubuntu2.3) ...
Setting up gcc (4:7.4.0-1ubuntu2.3) ...
Processing triggers for man-db (2.8.3-2ubuntu0.1) ...

但我仍然得到同样的错误

$ gcc --version
-bash: /usr/bin/gcc: cannot execute binary file: Exec format error

我还需要做什么才能解决这个问题?

相关内容