0

I accidently overwrote the ld file in /usr/bin. I then removed the file and reinstalled binutils. Now I get the error in the title when I try to compile a C++ file with g++.

The ld file is present in the /usr/bin directory, although it looks like a broken symlink. It points to a file called x86_64-linux-gnu-ld, which I am unable to find anywhere. How do I fix this?

prism
  • 3
  • 2

1 Answers1

0

/usr/bin/x86_64-linux-gnu-ld is itself a symbolic link, to /usr/bin/x86_64-linux-gnu-ld.bfd

$ ls -l /usr/bin/x86_64-linux-gnu-ld
lrwxrwxrwx 1 root root 23 Mar 12  2022 /usr/bin/x86_64-linux-gnu-ld -> x86_64-linux-gnu-ld.bfd

/usr/bin/x86_64-linux-gnu-ld.bfd is provided by the binutils-x86-64-linux-gnu package

$ dpkg -S $(realpath /usr/bin/ld)
binutils-x86-64-linux-gnu: /usr/bin/x86_64-linux-gnu-ld.bfd

So try re-installing binutils-x86-64-linux-gnu

steeldriver
  • 142,475