Ask Ubuntu is a question and answer site for Ubuntu users and developers. Join them; it only takes a minute:

Sign up
Here's how it works:
  1. Anybody can ask a question
  2. Anybody can answer
  3. The best answers are voted up and rise to the top

I have inadvertently overwritten file /usr/bin/ld. How can I reinstall this file?

share|improve this question
up vote 6 down vote accepted

dlocate is quite useful in this case to know for which package it came from:

$ dlocate /usr/bin/ld
binutils: /usr/bin/
binutils: /usr/bin/ld.bfd
binutils: /usr/bin/ld
libc-bin: /usr/bin/ldd

As it can be seen above, /usr/bin/ld is available through binutils package. Hence, you should be able to get it back by reinstalling that package:

$ sudo apt-get install --reinstall binutils
share|improve this answer
...or one can use dpkg -S /usr/bin/ld instead of dlocate. – arrange Dec 11 '11 at 18:13

Your Answer


By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.